in reply to Re: Spurious re 'eval'; warning ?
in thread Spurious re 'eval'; warning ?
I'm just playing around.
Returning a qr// regex is a work around.
I read perlre and re, and I consider "(?{1})" a valid return value. You can use other strings without a problem:
This snippet from perlre doesn't specify a regex ref or string (although it is pretty vague). The example which follows in the man page uses a recursive qr// definition (so does return a qr// object).$ id|perl -nle 'print /( (??{ q[uid=\d+] }) )/x' uid=1000
From perlre:
(??{ code })
...
The result of evaluation is considered as a regular
expression and matched as if it were inserted
instead of this construct.
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Re: Re: Spurious re 'eval'; warning ?
by CombatSquirrel (Hermit) on Aug 24, 2003 at 15:01 UTC | |
by diotalevi (Canon) on Aug 24, 2003 at 15:06 UTC |