Re: need some help using strict??



On 4/27/07, FamiLink Admin <webmaster@xxxxxxxxxxxx> wrote:

I am trying to verify a credit card number format with the following:
(below) but I am getting errors like:

Global symbol "%r" requires explicit package name at ./modmember.cgi line
681.

This is because, under 'use strict', you must declare %r in some way;
you can't simply start using it unexpectedly on line 681. The typical
way to fix this is to locate the logical beginning of that variable's
scope and add a line like this:

my(%r, $any_others);

Now you've declared the variables %r and %any_others you need for that
scope, so you won't surprise Perl and get those "requires explicit
package name" messages.

Hope this helps!

--Tom Phoenix
Stonehenge Perl Training
.



Relevant Pages

  • Re: Can anyone program perl and fix a script?
    ... (Missing operator before packets?) ... Global symbol "$tmp" requires explicit package name at ./natview line 14. ...
    (alt.os.linux)
  • Use Strict Question
    ... Global symbol "$OrderFile" requires explicit package name at theta.pl ... Global symbol "$referer" requires explicit package name at theta.pl ... Global symbol "@odate" requires explicit package name at theta.pl line ...
    (perl.beginners)
  • Re: First Perl/CGI need critique on current code before further developement
    ... The errors in this script are _pervasive_. ... with future reserved word at webcounter.pl line 12. ... Global symbol "$slash" requires explicit package name at webcounter.pl line ...
    (comp.lang.perl.misc)
  • Re: Modify program to write just data to a text file.
    ... Global symbol "%DB" requires explicit package name at t.pl line 46. ... Bareword "BorOblig" not allowed while "strict subs" in use at t.pl line 26. ...
    (comp.lang.perl.misc)
  • Re: Lost here.. Use of uninitialized value in print?
    ... Global symbol "@files1to5" requires explicit package name at D:\My ... Global symbol "$list1" requires explicit package name at D:\My ... Global symbol "$selectitem" requires explicit package name at D:\My ...
    (perl.beginners)