in reply to Re: Extract potentially quoted words
in thread Extract potentially quoted words
Although in Perl, most statements can also be used as expressions, there are a few exceptions. The while above is a statement modifier and cannot be used in an expression.
For example:
is still parsed as:push @elements, $1 while (/\G\s*"(.*?)"/gc or /\G\s*'(.*?)'/gc or /\G\s*(\S+)/gc) or die "Argh";
and if we try to force your desired interpretation:push @elements, $1 while( (/\G\s*"(.*?)"/gc or /\G\s*'(.*?)'/gc or /\G\s*(\S+)/gc) or die "Argh" );
we get: syntax error at line 1, near "$1 while" - tye (but my friends call me "Tye")(push @elements, $1 while /\G\s*"(.*?)"/gc or /\G\s*'(.*?)'/gc or /\G\s*(\S+)/gc) or die "Argh";
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Re: Re: Extract potentially quoted words
by merlyn (Sage) on Jun 07, 2001 at 02:30 UTC | |
by tye (Sage) on Jun 07, 2001 at 02:53 UTC | |
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 VSarkiss (Monsignor) on Jun 07, 2001 at 04:11 UTC | |
by merlyn (Sage) on Jun 07, 2001 at 17:23 UTC | |
|
Re: Re: Re: Extract potentially quoted words
by VSarkiss (Monsignor) on Jun 07, 2001 at 01:24 UTC |