Inside your subroutine, you are making copies of the referenced arrays (@arr1 and @arr2 are the copies), and then you are modifying the copies. If you want to change the original arrays, you should modify the references directly, something like this:
sub changem { my ($r1,$r2) = @_; print "BEFORE: $r2->[1]\n"; $r2->[1] = 'q'; print "AFTER: $r2->[1]\n"; }
-- Mike
--
just,my${.02}
In reply to Re: Array references inside a subroutine
by thelenm
in thread Array references inside a subroutine
by Anonymous Monk
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |