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