> Wiggins d Anconia wrote:
> 

<snip>

> >  
> >
> When I include warnings and strict is give me allot of warnings. What do 
> they mean?
> 
> <h1>Software error:</h1>
> <pre>Global symbol &quot;$surname&quot; requires explicit package name 
> at ola.cgi line 15.

<snip>

> ola.cgi had compilation errors.
> </pre>
> <p>
> For help, please send mail to this site's webmaster, giving this error 
> message
> and the time and date of the error.
> 
> </p>

<snip>

> [Thu Jul  8 15:05:23 2004] ola.cgi: Global symbol "$msg" requires 
> explicit package name at ola.cgi line 90.
> [Thu Jul  8 15:05:23 2004] ola.cgi: ola.cgi had compilation errors.
> 
> 

Whenever you come across an error/warning/diagnostic message you don't
recognize or understand you can find its meaning in,

perldoc perldiag

"Global symbol "%s" requires explicit package name
(F) Youâve said "use strict vars", which indicates that all variables
must either be lexically scoped (using "my"), declared beforehand using
"our", or explicitly qualified to say which package the global variable
is in (using "::")."

In this case you are not declaring your variables, adding a 'my' before
them will fix the issue in most cases.

perldoc -f my
perldoc strict
http://perl.plover.com/FAQs/Namespaces.html

For more, especially that last.

If you start out in the habit of including 'my' before your variables,
then when you screw up the name of one of them, then strict will yell at
you.  This is only one very small example of how it can help you and
save you time, no more hunting for misspelled variables.

http://danconia.org

-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
<http://learn.perl.org/> <http://learn.perl.org/first-response>


Reply via email to