my $DEBUG if exists...

Nick Estes plug-devel@lists.PLUG.phoenix.az.us
Sat May 12 19:09:01 2001


-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

> bash-2.05$ perl -V
> Summary of my perl5 (revision 5.0 version 6 subversion 0) configuration:

Same as me, so that's not the difference...

> %fxDEBUG is assigned keys that match the names of the program's functions.
> The value for the key is a number matching the DEBUG level that should be
> set locally for the function, if there has been an assignment for that
> function.

Ok, my guess was close enough then, I was putting in informative keys such
as 'asdf', and giving them scientific values like 42. (-=

> I did get it to work as I want using local(), but most everything says one
> should use my() instead of local(). I'm looking for temporary values, not
> private values, so the titles make me think I should be using local() :).
> 
> "A `local' just gives temporary values to global (meaning package)
> variables." That sounds like what I want, but I want to know which is better
> and why.

IIRC (and don't quote me on this), both my and local restrict access to
the scope you declare it in with the difference being local is like static
in C, and my is like a normal declaration in C.  99% of the time, my is
what you want (the only time I ever use local is when I'm playing with
file handles and that's only because I can't use my)

> Also I want to know why the my() isn't working. It was working last week
> when I was working on the program. No promises that I didn't change anything
> in the meantime :).

It _should_ work, the only thing I can think of is perhaps there's a
Windows system sitting too close to the box you're running this on? (-=

	--Nick
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.0.2 (GNU/Linux)
Comment: For info see http://www.gnupg.org

iD4DBQE6/2EBv+hjYTGg7s4RAkf2AJ9cGIn+3pnSIfKtkmpVgmu1cqT/7wCYk8IU
F8MNasjSRWG/NlekSXBNrQ==
=NjJ1
-----END PGP SIGNATURE-----