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

Andy Lester andy at petdance.com
Wed Mar 5 15:49:46 PST 2008


On Mar 5, 2008, at 5:46 PM, nheller at silcon.com wrote:

>    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.


The "at line 511" really means "the statement that starts on line 511"  
but it looks like you have a cascading if/else chain, and so the  
ENTIRE CHAIN is "at line 511".

Break up the else/ifs and you'll get a better pointer to the offending  
line.

xoxo,
Andy

--
Andy Lester => andy at petdance.com => www.petdance.com => AIM:petdance






More information about the SanFrancisco-pm mailing list