in reply to my $x or my ($x)
Because, in scalar context, an array variable will evaluate to it's length.my @x = ('a' .. 'e'); my $y = @x; my ($z) = @x; warn $y; # 5 warn $z; # 'a'
function foo { my ($bar, $stuff, $blah) = @_; # get the arguments ... }
|
---|
Replies are listed 'Best First'. | |
---|---|
Re^2: my $x or my ($x)
by johngg (Canon) on Apr 04, 2006 at 16:45 UTC |