develooper Front page | perl.perl5.porters | Postings from May 2004

Re: [perl #29701] perlbug: Inconsistencies between 'if/unless' and'while/until' w.r.t. localised variables

Thread Next
From:
Jason Rhinelander
Date:
May 20, 2004 03:47
Subject:
Re: [perl #29701] perlbug: Inconsistencies between 'if/unless' and'while/until' w.r.t. localised variables
Message ID:
40ABE86A.4080909@jagerman.com
I realized that I mixed up the outputs in the last command - the 
behaviour of the explicit local is not reversed as I indicated.

$ perl -le '$foo = 3; unless (local $foo = 4) { } print $foo'
4
$ perl -le '$foo = 3; until (local $foo = 4) { } print $foo'
3

This makes more sense, as the problem now appears to be with any 
localised variable, whether explicit or implicit.

-- Jason Rhinelander

Thread Next


nntp.perl.org: Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at ask@perl.org | Group listing | About