in reply to my variables in a subroutine
Produces:use strict; use warnings; { # Outer block my $keeps_value = 0; sub mysub { print "$keeps_value\n"; $keeps_value++ } } # End of outer block mysub(); mysub(); mysub();
The varibale $keeps_value is not visible outside the block.0 1 2
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: my variables in a subroutine
by Bloodnok (Vicar) on Mar 23, 2009 at 11:51 UTC | |
by cdarke (Prior) on Mar 23, 2009 at 11:59 UTC | |
by Anomynous Monk (Scribe) on Mar 23, 2009 at 16:38 UTC |