On Jun 3, 8:37 am, sono...@fannullone.us 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: beginners-unsubscr...@perl.org
For additional commands, e-mail: beginners-h...@perl.org
http://learn.perl.org/


Reply via email to