Re: Error: Unknown error
authorAdrian M. Enache <enache@rdslink.ro>
Tue, 8 Apr 2003 07:12:13 +0000 (10:12 +0300)
committerRafael Garcia-Suarez <rgarciasuarez@gmail.com>
Tue, 8 Apr 2003 19:47:05 +0000 (19:47 +0000)
Message-ID: <20030408041213.GA13553@ratsnest.hole>

p4raw-id: //depot/perl@19170

lib/fields.t
lib/strict.t
op.c
t/lib/strict/subs

index a505194..c4d5ef6 100755 (executable)
@@ -198,11 +198,11 @@ is( $Eval1::VERSION, 1.01 );
 is( $Eval2::VERSION, 1.02 );
 
 
-eval q{use base reallyReAlLyNotexists;};
+eval q{use base 'reallyReAlLyNotexists'};
 like( $@, qr/^Base class package "reallyReAlLyNotexists" is empty./,
                                           'base with empty package');
 
-eval q{use base reallyReAlLyNotexists;};
+eval q{use base 'reallyReAlLyNotexists'};
 like( $@, qr/^Base class package "reallyReAlLyNotexists" is empty./,
                                           '  still empty on 2nd load');
 
index 37bb4b3..b153771 100644 (file)
@@ -74,7 +74,7 @@ for (@prgs){
                      `perl -I../lib $switch $tmpfile 2>&1` :
                   $^O eq 'MacOS' ?
                      `$^X -I::lib -MMac::err=unix $switch $tmpfile` :
-                  `./perl $switch $tmpfile 2>&1`;
+                  `$^X $switch $tmpfile 2>&1`;
     my $status = $?;
     $results =~ s/\n+$//;
     # allow expected output to be written as if $prog is on STDIN
diff --git a/op.c b/op.c
index af1fd08..39089fb 100644 (file)
--- a/op.c
+++ b/op.c
@@ -4191,7 +4191,7 @@ Perl_newATTRSUB(pTHX_ I32 floor, OP *o, OP *proto, OP *attrs, OP *block)
        if (*s != 'B' && *s != 'E' && *s != 'C' && *s != 'I')
            goto done;
 
-       if (strEQ(s, "BEGIN")) {
+       if (strEQ(s, "BEGIN") && !PL_error_count) {
            I32 oldscope = PL_scopestack_ix;
            ENTER;
            SAVECOPFILE(&PL_compiling);
index 4516de7..9e32909 100644 (file)
@@ -361,3 +361,8 @@ print 1..1, bad;
 EXPECT
 Bareword "bad" not allowed while "strict subs" in use at - line 3.
 Execution of - aborted due to compilation errors.
+########
+eval q{ use strict; no strict refs; };
+print $@;
+EXPECT
+Bareword "refs" not allowed while "strict subs" in use at (eval 1) line 1.