in reply to Re: Determining depth of eval nesting
in thread Determining depth of eval nesting

Maybe you could override CORE::GLOBAL::eval and institute your own depth counter?

In this case, you may find helpful the recently released overload::eval module.

Update: As diotalevi pointed this module is only about eval STRING (and not eval BLOCK) and requires the latest devel Perl versions. So, maybe the module is not that helpful here.

Replies are listed 'Best First'.
Re^3: Determining depth of eval nesting
by diotalevi (Canon) on Apr 04, 2007 at 03:20 UTC

    No you won't. overload::eval is only about string eval and you need to be using perl 5.9+ anyway. It overloads the real internal eval function for objects of a particular class. It could be adapted in a 5.6+ compatible way to overload all string eval uses everywhere. To overload the eval block form would require entirely different code and might not even be possible to do cleanly.

    ⠤⠤ ⠙⠊⠕⠞⠁⠇⠑⠧⠊