http://www.perlmonks.org?node_id=694400


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...?

Replies are listed 'Best First'.
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