Piers wrote:

> Not exactly DWIM, but how about:
> 
>   my $stuff = /^\s* [ "(.*?)" | (\S+) ] : { $foo := $+ }/;
> 
> Assuming $+ means 'the last capture group matched' as it does now.
>

Or just:

     my $stuff = /^\s* [ "$foo:=(.*?)" | $foo:=(\S+) ]/;

BTW, that doesn't actually *do* the match. It merely puts a reference
to a rule object into $stuff.

Perhaps we all actually meant variants on:

     my $stuff = m/^\s* [ "$0:=(.*?)" | $0:=(\S+) ]/;

???

Damian




Reply via email to