Beefy Boxes and Bandwidth Generously Provided by pair Networks
good chemistry is complicated,
and a little bit messy -LW
 
PerlMonks  

Re^5: Announcing Perl-Critic-0.14

by Aristotle (Chancellor)
on Jan 30, 2006 at 17:59 UTC ( #526505=note: print w/ replies, xml ) Need Help??


in reply to Re^4: Announcing Perl-Critic-0.14
in thread Announcing Perl-Critic-0.14

Conclusion: Always assign something in a my declaration?

More precisely: make sure an assignment with a my on the left-hand side is never conditional.

Makeshifts last the longest.


Comment on Re^5: Announcing Perl-Critic-0.14
Select or Download Code
Re^6: Announcing Perl-Critic-0.14
by diotalevi (Canon) on Jan 30, 2006 at 21:08 UTC

    It's not about the assignment. It's that my() should never be conditional. my $foo if $bar is just as bad for the same reason. You're just not likely to write that because it looks funny. my $foo ... for ... is probably also just as bad. The statement modifier form allows the my() to declare the variable for use by all following statements in that scope.

    ⠤⠤ ⠙⠊⠕⠞⠁⠇⠑⠧⠊

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others romping around the Monastery: (17)
As of 2014-09-17 14:30 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    How do you remember the number of days in each month?











    Results (82 votes), past polls