in reply to Defining Subroutines
You got it backwards. Define a function with sub. You can call it with &max, but it's better to call using parentheses until you're comfortable with what the ampersand does. It causes prototypes to be ignored, and it arranges for the function to be called with the existing @_ as arguments.
After Compline,
Zaxo
|
---|
Replies are listed 'Best First'. | |
---|---|
Re: Re: Defining Subroutines
by rir (Vicar) on Oct 24, 2002 at 04:11 UTC | |
Re^2 Defining Subroutines
by @rocks (Scribe) on Oct 24, 2002 at 04:40 UTC |
In Section
Seekers of Perl Wisdom