On Tue, Oct 12, 2004 at 10:20:14AM +0100, "Orton, Yves" <[EMAIL PROTECTED]> wrote:
> 
> > while /foo$bar{baz}(?{$x=1})/U$x\E/ might give
> > 
> >     handler('foo',  'constant');
> >     handler('$bar{baz}' 'scalar');
> >     handler('$x=1', 're-code');
> >     handler('U',    'func');
> >     handler('$x',   'scalar');
> >     handler('E',    'func');
> > 
> > perhaps ????
> > 
> > Although I have no idea whether this would be useful.
> > 
> > > - at runtime give me the constant text
> > > - at runtime give me the variable name
> > > - at runtime give me the variable's SV
> > > - at runtime give me the interpolated text
> > 
> > I'm not quite sure how that would work, or why it would be useful.
> 
> Couldn't these be used by serialization code to properly recreate the regex
> in context? For instance:
> 
>  my($v,$r)=qw(Foo);
>  $r=qr/blah${r}blah/;
>  print Dumper($v,$r);
>  __END__
>  $VAR1='Foo';
>  $VAR2=qr/blah${VAR1}blah/;

IIRC, Ilya's original idea in implementing (??{ }) was that there
would also be a /p switch ( qr/blah${VAR1}blah/p ) that would do this.
(In fact, (??{ }) used to be (?p{ })).

Reply via email to