R. Joseph Newton wrote:
> James Edward Gray II wrote:
>
> > Almost. You have to declare them before you use them if you want
> > to leave of the parenthesis. :)
> >
> > James
>
> Actually, it is vice-versa.
Actually, James is correct. Quoting from perldoc perlsyn:
Declaring a subroutine allows a subroutine name to be used
as if it were a list operator from that point forward in
the program. You can declare a subroutine without defin-
ing it by saying "sub name", thus:
sub myname;
$me = myname $0 or die "can't get myname";
which is different from using prototypes.
> If you use prototypes, then the
> prototype must be declared before any call to the function. In that
> case,
> you will have a
> parameter list following the name in both the predeclaration
> and the header
> of the function. If you do not use prototypes, you sub can
> be declared
> anywhere within your script or imported from any module used
>
> When calling a function, other than a Perl built-in, you
> should always add
> the parameter list, enclosed in parentheses, even if it is empty.
--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]