in reply to Re: Re: Re: Extract potentially quoted words
in thread Extract potentially quoted words
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")
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: (tye)Re2: Extract potentially quoted words
by merlyn (Sage) on Jun 07, 2001 at 02:55 UTC | |
by tye (Sage) on Jun 07, 2001 at 02:56 UTC | |
by merlyn (Sage) on Jun 07, 2001 at 03:02 UTC | |
by tye (Sage) on Jun 07, 2001 at 03:13 UTC | |
by dws (Chancellor) on Jun 07, 2001 at 03:51 UTC | |
by Anonymous Monk on Jun 07, 2001 at 13:50 UTC |