Beefy Boxes and Bandwidth Generously Provided by pair Networks
P is for Practical
 
PerlMonks  

Re^5: postfix syntax enlightenment ( y $x if 0; Trick my @array = () if 0; conditional declaration; state )

by Anonymous Monk
on Mar 29, 2014 at 01:02 UTC ( [id://1080173]=note: print w/replies, xml ) Need Help??


in reply to Re^4: postfix syntax enlightenment
in thread postfix syntax enlightenment

when the perl5-porters update the documentation, and say "don't do that its undefined", then they mean it don't do that even if does something you expect 80% of the time :)

For example see Re^3: question 1st - undefined behaviour (perlop)

I'm sure there is even more similar nodes/posts of wisdom to be found for Perl::Critic::Policy::Variables::ProhibitConditionalDeclarations ... trust the documentation

update:
my $cache = undef if undef;
Re^4: Managing capture
"my $p = value if condition()" as bad|deprecated as "my $p if 0" (Naughty indeed)
This Week on p5p 2000/05/21 my $x if 0; Trick
my $x if 0; Trick my @array = () if 0;
state variables, first draft - nntp.perl.org
state

  • Comment on Re^5: postfix syntax enlightenment ( y $x if 0; Trick my @array = () if 0; conditional declaration; state )

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://1080173]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others drinking their drinks and smoking their pipes about the Monastery: (2)
As of 2024-04-20 03:46 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found