On Mon, Nov 01, 2004 at 08:24:34PM +0100, Leopold Toetsch wrote:
> Dan Sugalski <[EMAIL PROTECTED]> wrote:

> > Sounds like a job for pre and post handlers for subs and methods....
> 
> Pah. Sounds like a debug variable in the interpreter context (what we
> already have for errors and warnings - we might need a few more bits for
> level, though) and a bit more cleverness for the C<debug> opcode (which
> we have too).
> 
> Said buggy sub starts with:
> 
>   debug 0 # turn off or - debug -1 ... reduce level

Faffing with $^D in Perl 5 can be really useful.

> Returning from the sub restores automagically the old debug level,
> because it's in the interpreter context.

local $^D in Perl 5, which is also useful.

But we don't have pre and post handers in Perl 5, so I don't know if they'd
make the job easier.

Nicholas Clark

Reply via email to