in reply to When is $_ local and when is it not?
There is a difference between foreach and while because they are two totally different things. foreach always assigns to a variable when looping over a list, while while normally doesn't. It's just that while (<>) is an exception and only when there's a single diamond operator there's an implicite assignment to $_.
-- Abigail
|
---|
Replies are listed 'Best First'. | |
---|---|
Re: Re: When is $_ local and when is it not?
by iakobski (Pilgrim) on Jul 13, 2001 at 17:55 UTC | |
by Abigail (Deacon) on Jul 13, 2001 at 19:24 UTC | |
by jeffa (Bishop) on Jul 13, 2001 at 18:09 UTC | |
Re: Re: When is $_ local and when is it not?
by Hofmator (Curate) on Jul 13, 2001 at 17:42 UTC | |
by chipmunk (Parson) on Jul 13, 2001 at 18:24 UTC |