use warnings;
use strict;
sub complain {
require Carp;
Carp::carp "This should not work!";
}
####
[steve@kirk ~]$ perl -Mstrict -Mwarnings \
-le'sub complain{ require Carp; Carp::carp "This should not work!"; } \
complain'
This should not work! at -e line 1
main::complain() called at -e line 1
[steve@kirk ~]$ /tmp/bleadperl/bin/perl5.9.5 -Mstrict \
> -Mwarnings -le'sub complain{ require Carp;\
> Carp::carp "This should not work!"; } complain'
String found where operator expected at -e line 2, near "Carp::carp "This shoulld not work!""
(Do you need to predeclare Carp::carp?)
syntax error at -e line 2, near "Carp::carp "This should not work!""
Execution of -e aborted due to compilation errors.
##
##
[steve@kirk ~]$ /tmp/bleadperl/bin/perl5.9.5 -Mstrict \
-Mwarnings -le'sub complain{ require Carp; \
Carp::carp("This will work!"); } complain'
This will work! at -e line 1
main::complain() called at -e line 2