--- "Hill, Ronald" <[EMAIL PROTECTED]> wrote:

> try
> use vars qw($sec $min $hour $mday $mon $year);

This will satisfy strict, but in case anyone wonders, these are still
globals. If you do this in the main body of your program, these are
actually $main::sec, $main::min, ... $main::year. 

That means they can be accessed by any code, anywhere in your program.
While that can be a good thing, it's not something to do without a
reason. (a valid reason might be that you have until 2:00 to get this
program working.....but try not to go there. =o)

Similarly, saying

  my ($sec, $min, $hour, $mday, $mon, $year);

at the top of your program makes those variables lexical, so that only
things in the same scope can access them, but because they are scoped
at the top level of the file, everything in the file can access them.
If your program is only one file, then there's little difference. If
you intend to do a require or use, the importedd code (being in another
file) would be able to see the ones declared with 'use vars', but not
the ones declared with my().

While this may be of minimal interest to a beginner, make sure you
understand the difference: if you don't it will bite you one day soon.



__________________________________________________
Do You Yahoo!?
Get personalized email addresses from Yahoo! Mail - only $35 
a year!  http://personal.mail.yahoo.com/

Reply via email to