in reply to Making a variable in a sub retain its value between calls
sub foo { my $x if 0; print "X is ", $x++, $/; } foo() for 3 .. 5; ---- X is 0 X is 1 X is 2
|
---|
Replies are listed 'Best First'. | |
---|---|
Re^2: Making a variable in a sub retain its value between calls
by ikegami (Patriarch) on Apr 19, 2005 at 04:52 UTC |