sub t { @file = ('foo', 'moo', 'bar'); return @file; } @tmp = t(); print @tmp; # print t(); would also work...