Is mostly a question of front-loading. What part of the statement seems the most important in its context? If we're just trying to avoid warnings about undef values, then adding if defined $foo to the end of a statement seems less obnoxious than putting the condition up front.
When you need to add if defined $foo to the end of the statement it is often because of you do not know if the parameter is passed in case you use variable number of arguments to function or subroutine. As such it is a deficiency of the language, which currently does not allow defaults for parameters. May be
my $arg3=(defined($_[2]) : $_[2] : 0;
is slightly clearer is such cases
But if we're going to do a lot of processing on $line, then my $line = <$fh> or return; is probably clearer than return unless my $line = <$fh>;.
I disagree. The line
return unless my $line = <$fh>;.
to me is always preferable to
my $line = <$fh> or return; 
The latter is "idiomatic Perl" which I would recommend to avoid, as it is one of the reasons many people hate Perl. I think there are very few justified uses of this construct instead of if (and mainly by programmers with heavy experience in bash, where it is more natural ). For example
($debug) && say "Line=$line";
or
($?>0) && warn('...');

In reply to Re^9: What esteemed monks think about changes necessary/desirable in Perl 7 outside of OO staff by likbez
in thread What esteemed monks think about changes necessary/desirable in Perl 7 outside of OO staff by likbez

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.