U
usenet
Greetings. I was reading Steve Oualline's book, "Wicked Cool Perl
Scripts." In one of the scripts he illustrates a script to check
broken links on a website (page 22-25). Of course, this is a task which
is well suited to a recursive approach, and this approach interests me,
but I know little about how recursion is implemented in Perl (and the
perldocs have not proven helpful - but maybe I haven't looked in
the right place).
In lines 48-50, Mr. Oualline codes as follows:
48 sub process_url($); #Needed because this is recursive
49 sub process_url($)
50 { #etc - code which examines and qualifies the URL
Let's ignore the fact that he's using a subroutine prototype (Mr.
Conway would be appaled). What interests me is the comment on line 48,
which seems to be an empty subroutine declaration. Actually, I'm not
sure exactly WHAT this is, which is why I'm posting this question.
Unfortunately, this part of the script is not explained in the
commentary. What exactly is going on with this seemingly "empty"
declaration on line 48, and how/why is it necessary for the recursive
nature of the task?
I would appreciate a reference to some information which can help me
understand how Perl implements recursion, and what is happening in this
_WCPS_ example.
Thanks!
Scripts." In one of the scripts he illustrates a script to check
broken links on a website (page 22-25). Of course, this is a task which
is well suited to a recursive approach, and this approach interests me,
but I know little about how recursion is implemented in Perl (and the
perldocs have not proven helpful - but maybe I haven't looked in
the right place).
In lines 48-50, Mr. Oualline codes as follows:
48 sub process_url($); #Needed because this is recursive
49 sub process_url($)
50 { #etc - code which examines and qualifies the URL
Let's ignore the fact that he's using a subroutine prototype (Mr.
Conway would be appaled). What interests me is the comment on line 48,
which seems to be an empty subroutine declaration. Actually, I'm not
sure exactly WHAT this is, which is why I'm posting this question.
Unfortunately, this part of the script is not explained in the
commentary. What exactly is going on with this seemingly "empty"
declaration on line 48, and how/why is it necessary for the recursive
nature of the task?
I would appreciate a reference to some information which can help me
understand how Perl implements recursion, and what is happening in this
_WCPS_ example.
Thanks!