You're correct. Your example gives perl the code ; to execute (i.e. an empty statement; personally I tend to use -e 0 since it accomplishes the same thing and doesn't require quoting to prevent it from being interpreted by the shell). If nothing happens that's good, as it means that the CGI module was found and loaded correctly. Had it not found the module or something blew up you would have instead seen an error (and you could experimentally verify this by trying to load a non-existent module, e.g. perl -MThroatwarbler::Mangrove -e 0).
Update: Erm, anonomonk protestations to the contrary aside, either order works as I said.
$ perl -e 0 -MThroatwarbler::Mangrove Can't locate Throatwarbler/Mangrove.pm in @INC (@INC contains: /opt/lo +cal/lib/perl5/site_perl/5.8.9/darwin-2level /opt/local/lib/perl5/site +_perl/5.8.9 /opt/local/lib/perl5/site_perl /opt/local/lib/perl5/vendo +r_perl/5.8.9/darwin-2level /opt/local/lib/perl5/vendor_perl/5.8.9 /op +t/local/lib/perl5/vendor_perl/5.8.8 /opt/local/lib/perl5/vendor_perl/ +5.8.8/darwin-2level /opt/local/lib/perl5/vendor_perl /opt/local/lib/p +erl5/5.8.9/darwin-2level /opt/local/lib/perl5/5.8.9 .). BEGIN failed--compilation aborted. $ perl -MThroatwarbler::Mangrove -e 0 Can't locate Throatwarbler/Mangrove.pm in @INC (@INC contains: /opt/lo +cal/lib/perl5/site_perl/5.8.9/darwin-2level /opt/local/lib/perl5/site +_perl/5.8.9 /opt/local/lib/perl5/site_perl /opt/local/lib/perl5/vendo +r_perl/5.8.9/darwin-2level /opt/local/lib/perl5/vendor_perl/5.8.9 /op +t/local/lib/perl5/vendor_perl/5.8.8 /opt/local/lib/perl5/vendor_perl/ +5.8.8/darwin-2level /opt/local/lib/perl5/vendor_perl /opt/local/lib/p +erl5/5.8.9/darwin-2level /opt/local/lib/perl5/5.8.9 .). BEGIN failed--compilation aborted. $ perl -v This is perl, v5.8.9 built for darwin-2level Copyright 1987-2008, Larry Wall Perl may be copied only under the terms of either the Artistic License + or the GNU General Public License, which may be found in the Perl 5 source ki +t. Complete documentation for Perl, including FAQ lists, should be found +on this system using "man perl" or "perldoc perl". If you have access to + the Internet, point your browser at http://www.perl.org/, the Perl Home Pa +ge. $ perl5.10.0 -MThroatwarbler::Mangrove -e 0 Can't locate Throatwarbler/Mangrove.pm in @INC (@INC contains: /usr/lo +cal/lib/perl5/5.10.0/darwin-2level /usr/local/lib/perl5/5.10.0 /usr/l +ocal/lib/perl5/site_perl/5.10.0/darwin-2level /usr/local/lib/perl5/si +te_perl/5.10.0 .). BEGIN failed--compilation aborted. $ perl5.10.0 -e 0 -MThroatwarbler::Mangrove Can't locate Throatwarbler/Mangrove.pm in @INC (@INC contains: /usr/lo +cal/lib/perl5/5.10.0/darwin-2level /usr/local/lib/perl5/5.10.0 /usr/l +ocal/lib/perl5/site_perl/5.10.0/darwin-2level /usr/local/lib/perl5/si +te_perl/5.10.0 .). BEGIN failed--compilation aborted. $ perl5.10.0 -e 0 -MCGI $ perl5.10.0 -MCGI -e 0 $
The cake is a lie.
The cake is a lie.
The cake is a lie.
In reply to Re: perl -e ';' -MCGI
by Fletch
in thread perl -e ';' -MCGI
by Anonymous Monk
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |