our @array; # package vaiable @array = qw( foo bar ); sub foo{ my $var = shift; my $href = shift; my @array = $href->{pass_in} if defined $href and exists $href->{pass_in}; push @array, $var; print "contents : @array\n"; } print "outer scope - contents : @array\n"; foo(1); foo(2); print "outer scope - contents : @array\n"; __END__ outer scope - contents : foo bar contents : 1 contents : 1 2 outer scope - contents : foo bar