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, which everyone here will be quick to let you know you shouldn't do
unless you have an excellent reason for doing so.
Good luck!
At 04:58 PM 5/29/01 -0400, you wrote:
>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 above warning?
>
>
>#!/usr/bin/perl -w
># CGI Script
>use strict;
>
>require "libcgi2.pl";
>
>&parse_input; # sub in our library
>
>#strip leading or trailing white space from all our form elements
>foreach my $key (keys %FORM_DATA){
>$FORM_DATA{$key} =~ s/^\s+|\s+$//g;
>}
>
>....ect.....
>
>Maybe some one could chime in about explicit packages.
>
>
>Thanks
>Dave
>
>*====================================================*
>* Cora Connection Your West African Music Source *
>* http://www.coraconnection.com/ *
>* Resources, Recordings, Instruments & More! *
>*====================================================*
Peter Cline
Inet Developer
New York Times Digital