On Jun 3, 8:37 am, [email protected] wrote:
> ...
> I want to use "$name" in another loop just after this one, but when I
> do, I get "Global symbol $name requires explicit package".
>
One option is an outer enclosing block that'll
extend the scope of $name to that entire block:
{ # enclosing block
my $name;
for $name ( split //... ) { } # first loop
for $name ( ... ) { } # next loop
}
--
Charles DeRykus
--
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]
http://learn.perl.org/