[sf-perl] Can't figure this one out
Sergey Fetisov
sergey.fetisov at ask.com
Wed Mar 5 16:32: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
------------------------------------------------------------------------
------------
Yep, seems like a some line inside of the if/else statement caused the
error
By the way
if ($action =~ /start/i) {
&MainPage($q, \%p);
} elsif ($action =~ /new|del|edt|save/i ) {
{
seems better to me
Sergey
More information about the SanFrancisco-pm
mailing list