in reply to Re: looking for a good idiom: return this if this is true
in thread looking for a good idiom: return this if this is true

the overhead of eval
Huh? Are you confusing eval $string (which fires up a compiler) with eval {block} (which merely pushes a marker onto the return stack)?

-- Randal L. Schwartz, Perl hacker
Be sure to read my standard disclaimer if this is a reply.

  • Comment on Re^2: looking for a good idiom: return this if this is true

Replies are listed 'Best First'.
Re^3: looking for a good idiom: return this if this is true
by dws (Chancellor) on Mar 06, 2005 at 00:47 UTC

    Huh? Are you confusing ...

    No confusion here. The bookkeeping overhead (pushing a marker onto the return stack, though I recall eval doing a bit more than that) is on par with creating a temporary variable. In my mind, at least, that cancels any performance objections about using a temporary variable.

    eval'ing a string would be nuts, and I give you credit for not being that nuts.