Always use strict; use warnings;. You'd have gotten several warnings that would have indicated that subroutine parameters are not specified that way in Perl. Try this:
use strict; use warnings; my @array=qw(one two three); my $arref=\@array; sub func { my $aref = shift; $aref->[0]="four"; } &func($arref); print "@array";
In reply to Re: array ref problem
by almut
in thread array ref problem
by perlplayer
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |