RE: use strict / explicit packages

2001-05-30 Thread Paul
--- David Gilden <[EMAIL PROTECTED]> wrote: > Did I touch a nerve here or what? LOL!!! It happens. ;o] > Ge, all of this totally is confusing me, Haven't got a clue what you mean. ~grin~ > So you know where I am coming from, I'm taking > a second on-line CGI/PERL class that leaves a

Re: use strict / explicit packages

2001-05-29 Thread Me
> So by way of example what do I need > to add to my code so I can use the Strict Pragma? Strictly speaking, just use strict; Beyond that, just note the error messages that adding this generates, and go from there. > I take it that this is considered bad programing > style or is just out d

RE: use strict / explicit packages

2001-05-29 Thread David Gilden
Did I touch a nerve here or what? Ge, all of this totally is confusing me, So you know where I am coming from, I'm taking a second on-line CGI/PERL class that leaves a lot to be desired (if anyone knows a good up-todate on-line class, please let me know!) I will move up to learning CGI.pm, b

RE: use strict / explicit packages

2001-05-29 Thread Paul
--- "Brett W. McCoy" <[EMAIL PROTECTED]> wrote: > > Not to correct those smarter and more knowledgeable, I'd like to > > call a rephrase on that one. =o) > > my() makes a variable lexical, meaning it isn't in any package. > > packages equate to namespaces, which mean little or nothing to > > lexi

RE: use strict / explicit packages

2001-05-29 Thread Brett W. McCoy
On Tue, 29 May 2001, Paul wrote: > > %FORM_DATA (which I am guessing is defined and/or created in > > libcgi2.pl) isn't explicitly put into a package > > (which you correctly do with the $key scalar, using 'my'). > > Not to correct those smarter and more knowledgeable, I'd like to call a > rephra

RE: use strict / explicit packages

2001-05-29 Thread Paul
--- "Brett W. McCoy" <[EMAIL PROTECTED]> wrote: > > Line 9: Global symbol "FORM_DATA" requires explicit package name. > > How can I avoid the above warning? > > . . . > > %FORM_DATA (which I am guessing is defined and/or created in > libcgi2.pl) isn't explicitly put into a package > (which you co

RE: use strict / explicit packages

2001-05-29 Thread Brett W. McCoy
On Tue, 29 May 2001, David Gilden wrote: > After adding: > ' use strict; ' > and am now getting several warnings.. > > In my library I have %FORM_DATA declared, > > File "hd:Perl:Cgi class:useractive:guest book:guestin.pl"; > Line 9: Global symbol "FORM_DATA" requires explicit package name. > >

RE: use strict / explicit packages

2001-05-29 Thread Peter Cline
When using strict, you must make sure all of your variables are declared within the proper scope. This means that all variables must either be made lexical, by using my (restricts scope to current code block), fully qualified using a package name (i.e. $package::varname), or declared as local

RE: use strict / explicit packages

2001-05-29 Thread Morbus Iff
>I am using MacPerl here. Good! I love seeing Mac people learning Perl. >Line 9: Global symbol "FORM_DATA" requires explicit package name. In this case, you correctly localized the $key that you were using, but not the actual %FORM_DATA itself. Much like you did "my $key", simply add anoth

RE: use strict / explicit packages

2001-05-29 Thread David Gilden
Hello, I am using MacPerl here. After adding: ' use strict; ' and am now getting several warnings.. In my library I have %FORM_DATA declared, File "hd:Perl:Cgi class:useractive:guest book:guestin.pl"; Line 9: Global symbol "FORM_DATA" requires explicit package name. How can I avoid the ab