parv has asked for the wisdom of the Perl Monks concerning the following question:
In Perl 5.9.1+ a "[d]eprecated use of my() in false conditional" warning has been added for things like my $p if 0.
That is somewhat similar to this 2d construct...
# condition() could be a sub, or just a simple defined or # truth test(s). my $p = $q if condition();
... found in occasional places at work. Above conditional assignment during variable declaration does not generate any warnings.
Should I be concerned enough about the 2d construct to make changes? Is the 2d construct just as bad as 1st one?
A pair of hours later... Thank you all for various bits; I am on my way to commit the changes.
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: "my $p = value if condition()" as bad|deprecated as "my $p if 0" (worse)
by tye (Sage) on Jan 15, 2008 at 03:58 UTC | |
by parv (Parson) on Jan 15, 2008 at 04:49 UTC | |
|
Re: "my $p = value if condition()" as bad|deprecated as "my $p if 0"
by ikegami (Patriarch) on Jan 15, 2008 at 04:05 UTC | |
by parv (Parson) on Jan 15, 2008 at 05:15 UTC | |
|
Re: "my $p = value if condition()" as bad|deprecated as "my $p if 0" (Naughty indeed)
by grinder (Bishop) on Jan 15, 2008 at 08:06 UTC | |
|
Re: "my $p = value if condition()" as bad|deprecated as "my $p if 0"
by perrin (Chancellor) on Jan 15, 2008 at 05:04 UTC | |
| A reply falls below the community's threshold of quality. You may see it by logging in. |