develooper Front page | perl.perl5.porters | Postings from July 2008

Re: my $foo = "bar" if $baz;

Thread Previous | Thread Next
From:
Andy Armstrong
Date:
July 10, 2008 18:38
Subject:
Re: my $foo = "bar" if $baz;
Message ID:
2CC345CC-1741-4649-82F3-CFE7F3DE7B16@hexten.net
On 11 Jul 2008, at 02:30, David Golden wrote:
>> From perldelta on 5.10.0:
>
>  Deprecated use of my() in false conditional
>      A new deprecation warning, *Deprecated use of my() in false
>      conditional*, has been added, to warn against the use of the  
> dubious
>      and deprecated construct
>
>          my $x if 0;
>
> I'd always heard not to initialize my variables in a conditional  
> statement.


Yeah, it's obviously a bad idea - but it shouldn't trample on memory  
(assuming that's what's happening).

-- 
Andy Armstrong, Hexten




Thread Previous | 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