How fast is an EVAL String

Scott Penrose scottp at dd.com.au
Tue Apr 27 00:32:03 CDT 2004


-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1


On 27/04/2004, at 11:46 AM, leif.eriksen at hpa.com.au wrote:

> Just for completeness, I sent Scott a reference to the different ways 
> Perl processes
>
> eval "string";
>
> And
>
> eval { block }
> (from perldoc -f eval)

eval {block} has almost no impact on performance over {block}, which is 
great.
But this does not apply to my example - you can take a string "a->b->c" 
and use eval {} on that string to get the cascaded methods. You must 
use eval string. Have a look at the list being provided into the 
method. The whole purpose of the ->data1|2 method is to replace this 
string with a set of methods called one after another. This can be done 
with recursion, iteration or a string eval. I think that if we had tail 
recursion that recursion would probably be the fastest, but since we 
don't then iteration seems now to be the fastest.

Scott
- -- 
Scott Penrose
Anthropomorphic Personification Expert
http://search.cpan.org/search?author=SCOTT
scott at cpan.org

Dismaimer: While every attempt has been made to make sure that this 
email only contains zeros and ones, there has been no effort made to 
guarantee the quantity or the order.

Please do not send me Word or PowerPoint attachments.
See http://www.fsf.org/philosophy/no-word-attachments.html
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.2.3 (Darwin)

iD8DBQFAjfBTDCFCcmAm26YRApooAJwIECYfaWuxASoyoSeh06Dw/jeD1ACfULmO
7LKco30Kw8Aaps58eM/UZEw=
=Fbkm
-----END PGP SIGNATURE-----




More information about the Melbourne-pm mailing list