in reply to Re: perl -e ';' -MCGI
in thread perl -e ';' -MCGI

Not in his case, in his case -MCGI is the first argument to the ; program (; being the first argument to the -e switch)

Replies are listed 'Best First'.
Re^3: perl -e ';' -MCGI
by ikegami (Patriarch) on Oct 28, 2010 at 18:54 UTC

    -e does not end the processing of the options.

    $ perl -e'print "a\n";' -e'print "b\n";' a b

    And an example with -M:

    $ perl -e'print "a\n";' -e'print "b\n";' -MO=Deparse print "a\n"; print "b\n"; -e syntax OK
Re^3: perl -e ';' -MCGI
by Anonymous Monk on Oct 28, 2010 at 13:37 UTC
    Actually yes, to get perl to stop processing switches after -e you need to use --,
    $ perl -le"print for @ARGV, keys %INC " -MCGI -- -MCGI -MCGI warnings/register.pm Carp.pm vars.pm strict.pm Exporter.pm constant.pm warnings.pm CGI/Util.pm overload.pm CGI.pm
      C:\> perl -le"print for @ARGV, keys %INC " -MCGI warnings/register.pm Carp.pm vars.pm Exporter.pm strict.pm C:/Perl64/site/lib/sitecustomize.pl constant.pm warnings.pm CGI/Util.pm overload.pm CGI.pm