use strict; use warnings; sub scope_test() { my @test_array = (1, 2, 3, 4, 5, 6); return \@test_array; } print join ("\n", @{ scope_test() } );