>>>>> "sw" == shawn wilson <[email protected]> writes:
sw> On Jun 3, 2011 3:17 PM, "Uri Guttman" <[email protected]> wrote: >> >> >> perl -le 'my $x = "zzz" ; for $x ( qw( foo bar ) ) { print "L: $x" } print sw> "E: $x"' >> L: foo >> L: bar >> E: zzz sw> That's odd, I would have thought that would have given 'foo bar bar'. So, sw> how would you keep data from a loop once you're outside of the loop? you don't use a loop variable for that. just declare it before the loop, assign as needed inside the loop and it will be there. if that gets messy as it can, i change the code to use a sub with the loop inside and return the value. uri -- Uri Guttman ------ [email protected] -------- http://www.sysarch.com -- ----- Perl Code Review , Architecture, Development, Training, Support ------ --------- Gourmet Hot Cocoa Mix ---- http://bestfriendscocoa.com --------- -- To unsubscribe, e-mail: [email protected] For additional commands, e-mail: [email protected] http://learn.perl.org/
