in reply to How do I add entries to a hash array in a different scope?

This isn't really a scope question. The problem is: you can't store an array in a hash. You can store an arrayref though.
use strict; # important use warnings; # important my %debug; # you rarely want our (or local) test_push(\%debug); print "hey, it works: $_\n" for @{ $debug{stack} # this probably contains our arrayref || [] # but if it doesn't, don't error out please }; sub test_push { # avoid camel case (imo) my ($debug) = @_; push @{ $debug->{stack} }, "lol"; # avoid unnecessary derefs # or my $ar = $debug->{stack}; push @$ar, "lol2"; return; }

Check out docs like perlreftut, perldata, perllol for further information.

-Paul