In article <[EMAIL PROTECTED]>,
 [EMAIL PROTECTED] (Mike Ni) writes:
>While I was playing with perl's built-in debuger 
>(perl -d),  I notice that  debugger doesn't seem
>care too much about whether a variable is declared?
>
>For example, I would get response of "empty hash" if 
>I do a "x \%dummy" regardless dummy hasn't been
>delcared yet. 
>
>The same response "empty hash" if I dump a declred
>hash before it is initialize. 
>
>It is as if there isn't too much difference between an
>undeclared variable & unitialized variable? 
>
>Is this the way it is ? Or I am not doing right? 

That is the way it is.  The debugger evaluates your
commands in a lexical scope within which "use strict"
has not been declared.  You can't make it be strict
without editing the debugger (perl5db.pl).  This is
just as well, the debugger is a sandbox.

The same goes for use warnings, but if you use the -w
or -W flags instead, they are non-lexical and will
extend to the debugger.  Try the p command on an
undefined value some time with -w enabled and you'll
see a quite verbose and annoying message.  One reason
to use warnings instead of -w is to avoid that spew
when debugging.

-- 
Peter Scott
http://www.perldebugged.com/
*** NEW *** http://www.perlmedic.com/

-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
<http://learn.perl.org/> <http://learn.perl.org/first-response>


Reply via email to