2 if( $ENV{PERL_CORE} ) {
11 # this script checks that errors on self-loaded
12 # subroutines that affect $@ are reported
15 unless ($@ =~ /^syntax error/) {
18 print "ok 1 - syntax errors are reported\n";
30 # by Bo Lindbergh <blgl@hagernas.com>, at Aug 22, 2006 5:42 PM
32 # In the example below, there's a syntax error in the selfloaded
33 # code for main::buggy. When the eval fails, SelfLoader::AUTOLOAD
34 # tries to report this with "croak $@;". Unfortunately,
35 # SelfLoader::croak does "require Carp;" without protecting $@,
36 # which gets clobbered. The program then dies with the
37 # uninformative message " at ./example line 3".
39 # #! /usr/local/bin/perl