in reply to Re^2: CGI::Appl can't find sub
in thread CGI::Appl can't find sub

Okay, then please explain the output from the "perl -MO=Terse", which is:

Bareword "CA_list" not allowed while "strict subs" in use at line 309. BEGIN not safe after errors--compilation aborted at line 423.

Note that line 423 is about 15 lines into the *next* subroutine after the one with the bareword parameter. Adding double quotes to the parameter fixed the problem. What made this so hard to root cause is that the problem did not cause the subroutine with the problem to fail. The error message also corresponds with what was observable in the perl debugger - "S AA" failed to show any subroutines after the one that contained line #309.

Replies are listed 'Best First'.
Re^4: CGI::Appl can't find sub
by Anonymous Monk on Jun 14, 2014 at 09:31 UTC

    Okay, then please explain the output from the "perl -MO=Terse", which is ...

    Ask yourself , why am I using barewords?

    If they're not function/package names, or hash keys, then they shouldn't be barewords

    If your barewords are strings, you should quote your strings

    perlintro, Basic debugging checklist and brian's Guide to Solving Any Perl Problem

    If this code you posted in Re: CGI::Appl can't find sub is any indication it means perintro was skipped

    $ perl -c syntax error at line 4, near "use strict use warning " syntax error at line 8, near "}" had compilation errors.

    Tracking down syntax errors is very easy, its

    perl -c perl -c lib/ ...

    When you're developing , skip B::Terse, don't forget to test every single subroutine in you write in your test suite, so even if eval is hiding any die-ing you'll notice when you typo

    Hi :)