[sf-perl] Can't figure this one out

nheller at silcon.com nheller at silcon.com
Wed Mar 5 15:46:51 PST 2008


Here's an error that I can't figure out for the life of me.
The code is short; I can't figure out why the compiler thinks $action (on
the marked line) is a bare word.

The actual error message follows the source code.
I would really appreciate any help.

{
    my ($q, $ins, $action, %p, $p);

    $q = new CGI;
    $action = $q->param('action');
    $action = 'start' unless $action;

    if ($action =~ /start/i) {     <-------- line 511, the offender
        &MainPage($q, \%p);
    }
    elsif ($action =~ /new/i ||
           $action =~ /del/i ||
           $action =~ /edt/i ||
           $action =~ /save/i )
    {



[imiuser at adopt nheller]$ perl -c ad_cases.cgi
Bareword "action" not allowed while "strict subs" in use at ad_cases.cgi
line 511.
ad_cases.cgi had compilation errors.
[imiuser at adopt nheller]$ vi ad_cases.cgi
[imiuser at adopt nheller]$




More information about the SanFrancisco-pm mailing list