HACKER Nora wrote:
If you do:
my ($var1) = @_;
You're doing list assignment and, as a result, you assign $var1 to the
$_[0]
and don't make use of $_[1], $_[2], $_[3], etc., which may or may not
exist.
Thanks, perfectly clear now.
In 'perldoc perlsub' I read that I only have to use
parentheses when defining more than one variable.
Where do you see that written?
Gnah, it was in the "local" section ... And it does NOT say "... ONLY
when more than one ...". Apologies for that. Note to self: Make checkup
appointment with optician.
Actually, it's true:
my $var1;
( $var1 ) = @_;
Also:
my $var1 = $_[0];
And:
my $var1 = shift @_;
--
Just my 0.00000002 million dollars worth,
Shawn
Programming is as much about organization and communication
as it is about coding.
I like Perl; it's the only language where you can bless your
thingy.
Eliminate software piracy: use only FLOSS.
--
To unsubscribe, e-mail: beginners-unsubscr...@perl.org
For additional commands, e-mail: beginners-h...@perl.org
http://learn.perl.org/