From: "Chas. Owens" <chas.ow...@gmail.com> > On Tue, Apr 28, 2009 at 13:38, Gunnar Hjalmarsson <nore...@gunnar.cc> wrote: > snip > >> Fully qualified names do not trip strict. Which is a reason to avoid > >> using them. I once work at a place that wrote Perl 5 as if it were > >> still Perl 4. They had turned on strict because they had heard it was > >> the right thing to do, but their response to it failing their scripts > >> was to move to using only fully qualified variables. > > > > A few years ago I made that same mistake in a rather large Perl program, and > > I believe that my mistake was caused by the fact that that was just what > > Perl requested me to do. > > > > $ perl -Mstrict -e'$var=""' > > Global symbol "$var" requires explicit package name at -e line 1. > > Execution of -e aborted due to compilation errors. > > $ > > > > The wording of that error message isn't very well thought out. :( > snip > > I believe the standard response is "patches are welcome." <grin>
Well, the first thing the message says is that the "$var" is a global symbol. That's the first thing you should be thinking about. Do I want the variable to be global? OK, if I wanted it to be global I would add the explicit package, but I do not want it to be global. What do I do? Jenda ===== je...@krynicky.cz === http://Jenda.Krynicky.cz ===== When it comes to wine, women and song, wizards are allowed to get drunk and croon as much as they like. -- Terry Pratchett in Sourcery -- To unsubscribe, e-mail: beginners-unsubscr...@perl.org For additional commands, e-mail: beginners-h...@perl.org http://learn.perl.org/