On May 6, Jason Frisvold said:

>I put 'use strict' at the beginning of one of my scripts...  It
>basically "broke" the script...  (or fixed it, if you want to look at it
>that way) ....  The problem is that it wanted explicit package names for
>all of the globals...
>
>So, what is the proper way to handle a global?  Do I 'my' all the
>globals in the program?

Globals can cause problems.  It's safer to use properly scoped lexicals.

The general answer is declare all your variables with 'my', and then fix
any scope issues that appear.

-- 
Jeff "japhy" Pinyan      [EMAIL PROTECTED]      http://www.pobox.com/~japhy/
RPI Acacia brother #734   http://www.perlmonks.org/   http://www.cpan.org/
** Look for "Regular Expressions in Perl" published by Manning, in 2002 **
<stu> what does y/// stand for?  <tenderpuss> why, yansliterate of course.
[  I'm looking for programming work.  If you like my work, let me know.  ]


-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to