Additional safeguard against $@ getting trampled; idea from Hugo.
Jarkko Hietaniemi [Tue, 29 May 2001 12:34:53 +0000 (12:34 +0000)]
p4raw-id: //depot/perl@10279

lib/utf8_heavy.pl

index 7a70e29..3ac4ef9 100644 (file)
@@ -34,11 +34,16 @@ sub SWASHNEW {
     } else {
        $file =~ s#^(Is|To)([A-Z].*)#$1/$2#;
     }
-    $list ||= ($caller ne 'main' && eval { $caller->$type(); })
-       || do "$file.pl"
-       || do "$encoding/$file.pl"
-       || do "$encoding/Is/${type}.pl"
-       || croak("Can't find $encoding character property \"$type\"");
+
+    {
+       local $@;
+
+       $list ||= ($caller ne 'main' && eval { $caller->$type(); })
+           || do "$file.pl"
+           || do "$encoding/$file.pl"
+           || do "$encoding/Is/${type}.pl"
+           || croak("Can't find $encoding character property \"$type\"");
+    }
 
     $| = 1;