SQADude has asked for the wisdom of the Perl Monks concerning the following question:
our %debug = (); $debug{'level'} = 1; $debug{'stack'}[0] = "main()"; $rv = MyModule::testStack(\%debug); my @t = $debug{'stack'}; my $CountMain = scalar (@t); print "$CountMain \n"; # This prints 1 #Now there is another subroutine defined in another module: sub testStack { my $ptr = $_[0]; my %h = %$ptr; my @a = $h{'stack'}; push (@a, "testStack()"); my $count = scalar (@a); print "$count \n"; # This prints 2 return 1; }
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: How do I add entries to a hash array in a different scope?
by jettero (Monsignor) on Oct 10, 2009 at 11:41 UTC | |
|
Re: How do I add entries to a hash array in a different scope?
by zwon (Abbot) on Oct 10, 2009 at 11:43 UTC | |
|
Re: How do I add entries to a hash array in a different scope?
by NetWallah (Canon) on Oct 10, 2009 at 15:36 UTC |