... sub simpleTest{ ... my @i = qw(1 5 3 4 6 7); return @i; } my @test; @test = simpleTest(); #### sub testFunc{ my $i = 0; $i++; testFunc(); }