use strict; use warnings; my @array = qw( a b c d e ); sub test { return @array; } test() = qw( A B C D E ); __END__ Can't modify non-lvalue subroutine call in scalar assignment at script.pl line 10, near "qw( A B C D E );"