Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

[S05] /ee

0 views
Skip to first unread message

Dr.Ruud

unread,
May 5, 2006, 9:25:29 AM5/5/06
to perl6-l...@perl.org
<quote>
Instead of /ee say:
s/pattern/{ eval doit() }/
</quote>

s/eval/try/ ?

--
Affijn, Ruud

"Gewoon is een tijger."

Juerd

unread,
May 5, 2006, 9:46:45 AM5/5/06
to perl6-l...@perl.org
Dr.Ruud skribis 2006-05-05 15:25 (+0200):
> > s/pattern/{ eval doit() }/
> s/eval/try/ ?

No, string eval stays eval. Only block eval is renamed to try.


Juerd
--
http://convolution.nl/maak_juerd_blij.html
http://convolution.nl/make_juerd_happy.html
http://convolution.nl/gajigu_juerd_n.html

Ruud H.G. van Tol

unread,
May 5, 2006, 10:22:17 AM5/5/06
to perl6-l...@perl.org
Juerd schreef:
> Dr.Ruud:
>> S05:

>>> s/pattern/{ eval doit() }/
>>
>> s/eval/try/ ?
>
> No, string eval stays eval. Only block eval is renamed to try.

Understood, but I was thinking about variants like

{ eval '' ~ doit() }
{ eval $\&doit }

and then wasn't sure anymore whether "eval doit()" is a string eval or
not.


$ perl5 -le 'sub x{print"<x>"; "<z>"}; print(":". eval( "x()" ) .":")'
<x>
:<z>:

$ perl5 -le 'sub x{print"<x>"; "<z>"}; print(":". eval {x()} .":")'
<x>
:<z>:

$ perl5 -le 'sub x{print"<x>"; "<z>"}; print(":". eval( {x()} ) .":")'
<x>
::

$ perl5 -le 'sub x{print"<x>"; "<z>"}; print(":". eval( x() ) .":")'
<x>
::

--
Groet, Ruud

0 new messages