in reply to Prevent my STDERR logging in evals...

Ant said: "Is there some easy way to catch the fact I'm in an eval so I can suppress writing the message to the error file?"

I seem to remember that  caller(0) can give you that information. You have to specify the call-frame explicitly to get the full spectrum of data. The fourth element of the array is 'subroutine name', if you are in an eval block it reads '(eval)'.

----
I Go Back to Sleep, Now.

OGB

Replies are listed 'Best First'.
Re^2: Prevent my STDERR logging in evals...
by ikegami (Patriarch) on May 08, 2008 at 00:11 UTC
    $^S is an easier way to check if you're in an eval.