use strict; use warnings; my @array = qw( a b c d e ); sub test { return @array; } my $aref = \(test()); @{$aref} = qw( A B C D E ); __END__ Not an ARRAY reference at script.pl line 11.