Article View: comp.lang.perl.misc
Article #242Re: eval and Speed
From: Andrew M. Langmead
Date: Mon, 15 Apr 1996 00:00
Date: Mon, 15 Apr 1996 00:00
18 lines
1317 bytes
1317 bytes
si0015@aixrs1.hrz.uni-essen.de (Olaf Walkowiak) writes: >Should I avoid the use of "eval" if possible, or doesnt it slow down >the speed very much? It depends on whether you mean what the man page calls "eval EXPR" or "eval BLOCK". "eval BLOCK" is pre-compiled, like the regular script, and exerts little run time impact. (less than a subroutine call.) It can be used to trap runtime errors. "eval EXPR" has the expression compiled each time it is encountered. It can have serious security implications, can be very slow (if possible don't put it in an inner loop, eval the whole outer loop instead.), and is usually can be replaced more effectively with references. -- Andrew Langmead
Technical Details
Message-ID:
<DpwMHo.4JH@world.std.com>Path:
arc1-ca.pugleaf.net!unknown!not-for-mailReferences:
<4krgge$fn2@sun1.uni-essen.de>Show Full Headers
Complete Article Headers
X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 1043e7,b3b96df39b5a8de7 X-Google-Attributes: gid1043e7,public X-Google-Thread: fd796,b3b96df39b5a8de7 X-Google-Attributes: gidfd796,public X-Google-Thread: fa0ae,b3b96df39b5a8de7 X-Google-Attributes: gidfa0ae,public From: aml@world.std.com (Andrew M. Langmead) Subject: Re: eval and Speed Date: 1996/04/15 Message-ID: <DpwMHo.4JH@world.std.com> X-Deja-AN: 147586039 references: <4krgge$fn2@sun1.uni-essen.de> organization: The World @ Software Tool & Die newsgroups: comp.lang.perl.misc,fj.lang.perl,comp.infosystems.www.authoring.cgi