Beefy Boxes and Bandwidth Generously Provided by pair Networks
Perl Monk, Perl Meditation
 
PerlMonks  

Re: Are there any other statements that are like return if...?

by jds17 (Pilgrim)
on Jun 27, 2008 at 17:38 UTC ( #694400=note: print w/ replies, xml ) Need Help??


in reply to Are there any other statements that are like return if...?

Yes, it's plain Perl syntax, but e.g. the classic Perl Best Practices by Damian Conway as well as the corresponding Module Perl::Critic (which you can use as a code quality tool for your own code) are against such postfix contructs for readability and maintainability reasons, the sole exception being postfix if as in your example for simple control statements. (You can change the behaviour of Perl::Critic if you want to use it but disagree with this, see the documentation!)

Personally I use postfix only in case the whole block fits in one line.


Comment on Re: Are there any other statements that are like return if...?
Re^2: Are there any other statements that are like return if...?
by Anonymous Monk on Jun 29, 2008 at 11:12 UTC
    Yeah, classic 2005

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others browsing the Monastery: (11)
As of 2014-10-23 11:32 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    For retirement, I am banking on:










    Results (125 votes), past polls