in reply to Re^3: Why doesn't Perl provide %_ as the hash equivalent of @_ in subs?
in thread Why doesn't Perl provide %_ as the hash equivalent of @_ in subs?
that doesn't mean the magic variable should not be provided at all, it just means it should be read-only.That looks like inconsistency to me.
andsub f1 { my ($x, $y) = @_; z($x, $y); }
sub f2 { z($_[0], $_[1]); }
prints 4sub z { $_[0]++; print $_[1] } sub f1 { my ($x, $y) = @_; z($x, $y); } my $x = 4; f1($x, $x);
prints 5sub z { $_[0]++; print $_[1] } sub f2 { z($_[0], $_[1]); } my $x = 4; f2($x, $x);
|
|---|