To quote perlsyn.pod:

The only kind of simple statement is an expression evaluated for its side effects.

Take a random Perl script you have lying about somewhere. Most of the statements in that code will likely be simple statments, that is, just an expression. Such statements can be used as expressions since they are, um, just "an expression evaluated for its side effects". You could put "my @value=" in front of it to demonstrate that fact and most of the time you end up with valid Perl code.

There are lots of times where I take code that was a statement and rework code around such that I'm now using that statement as an expression (for example, by moving it into the condition of an if or while).

But if you have a statement that isn't so simple, moving into a "context" where an expression is required will probably get you a syntax error.

        - tye (but my friends call me "Tye")

In reply to (tye)Re2: Extract potentially quoted words by tye
in thread Extract potentially quoted words by merlyn

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.