in reply to Re: use simple scalar names to point to specific array elements
in thread use simple scalar names to point to specific array elements
How this works is an exercise left to the reader :)
Well, it doesn't actually work at all.
All it does is return the value of the array referenced in $_[0] at the index $_[1]. The aliasing of sub args isn't helping like you think it is.$ perl -le 'sub alias_to { $_[0]->[$_[1]] } my @x = (1,2,3); my $z=ali +as_to(\@x,1); print $z; $z=42; print $x[1]' 2 2
-sauoq "My two cents aren't worth a dime.";
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Re: Re: use simple scalar names to point to specific array elements
by Ovid (Cardinal) on Dec 06, 2003 at 00:39 UTC | |
by sauoq (Abbot) on Dec 06, 2003 at 01:30 UTC |