in reply to array ref problem
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";
|
|---|