in reply to Detect undefined subroutines

Don't use parens:
~/info> perl -Mstrict -c -e 'foo()' -e syntax OK ~/info> perl -Mstrict -c -e 'foo' Bareword "foo" not allowed while "strict subs" in use at -e line 1. -e had compilation errors.

Replies are listed 'Best First'.
Re^2: Detect undefined subroutines
by ihb (Deacon) on Sep 18, 2004 at 20:57 UTC

    That doesn't always work due to indirect object syntax. Here's an example of when lack of parenthesis doesn't help, and the call instead gets interpreted as a method call rather than a function call.

    $ perl -Mstrict -cwe 'my $bar; foo $bar;' -e syntax OK

    ihb

    Read argumentation in its context!