"M. Kristall" schreef:
> Ruud:

>> [ while(local $_ = <ARGV>) ]
>> With while(), the $_ is already local. <not!>
>> Wouldn't using that 'local' explicitly, add another local-layer?
>
> my $i = 5;
> $_ = 'Hi there!!!';
> while ($_ = $i--) { print }
> print
> 543210
>
> my $i = 5;
> $_ = 'Hi there!!!';
> while (local $_ = $i--) { print }
> print
> 54321Hi there!!!

Right, I must've been mixing up with "for":

perl -e 'sub _{local $\=qq[\n];print qq[<$_>]};
$_=q[------];_;do{_;print for(1..5);_}for q[A]..q[C];_'

<------>
<A>
12345<A>
<B>
12345<B>
<C>
12345<C>
<------>

-- 
Affijn, Ruud
http://www.xs4all.nl/~rvtol/Perl/japh.wav
"Gewoon is een tijger."



-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
<http://learn.perl.org/> <http://learn.perl.org/first-response>


Reply via email to