> -----Original Message----- > From: Jason Frisvold [mailto:[EMAIL PROTECTED]] > Sent: Monday, May 06, 2002 11:19 AM > To: [EMAIL PROTECTED] > Subject: use strict > > > I have a question about 'use strict' ... Yeah, I guess this > counts as > a "duh!" question... :-) > > 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?
probably, yes. "use strict" is there to help you catch typos, by forcing you to either declare all variables or use explicit package names. Generally you will want to declare your globals with "my" at the top of your script. This creates file-scoped lexicals, which are similar to globals in terms of visibility, but do not live in the symbol table. If you really need symbol table (i.e. "package") variables, then use "our" instead of "my". The main reason you would need a package variable is if the variable needs to be accessed from another file or module directly, instead of being passed as an argument. -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]