if (!stash) {
if (add) {
- warn("Global symbol \"%s\" requires explicit package name", name);
+ char sv_type_char = ((sv_type == SVt_PV) ? '$'
+ : (sv_type == SVt_PVAV) ? '@'
+ : (sv_type == SVt_PVHV) ? '%'
+ : 0);
+ if (sv_type_char)
+ warn("Global symbol \"%c%s\" requires explicit package name",
+ sv_type_char, name);
+ else
+ warn("Global symbol \"%s\" requires explicit package name", name);
++error_count;
stash = curstash ? curstash : defstash; /* avoid core dumps */
add_gvflags = ((sv_type == SVt_PV) ? GVf_IMPORTED_SV
use strict ;
$fred ;
EXPECT
-Global symbol "fred" requires explicit package name at - line 4.
+Global symbol "$fred" requires explicit package name at - line 4.
Execution of - aborted due to compilation errors.
########
use strict 'vars' ;
$fred ;
EXPECT
-Global symbol "fred" requires explicit package name at - line 4.
+Global symbol "$fred" requires explicit package name at - line 4.
Execution of - aborted due to compilation errors.
########
use strict 'vars' ;
local $fred ;
EXPECT
-Global symbol "fred" requires explicit package name at - line 4.
+Global symbol "$fred" requires explicit package name at - line 4.
Execution of - aborted due to compilation errors.
########
$joe = 1 ;
EXPECT
Variable "$joe" is not imported at - line 8.
-Global symbol "joe" requires explicit package name at - line 8.
+Global symbol "$joe" requires explicit package name at - line 8.
Execution of - aborted due to compilation errors.
########
}
$joe = 1 ;
EXPECT
-Global symbol "joe" requires explicit package name at - line 6.
+Global symbol "$joe" requires explicit package name at - line 6.
Execution of - aborted due to compilation errors.
########
require "./abc";
EXPECT
Variable "$joe" is not imported at ./abc line 2.
-Global symbol "joe" requires explicit package name at ./abc line 2.
+Global symbol "$joe" requires explicit package name at ./abc line 2.
Compilation failed in require at - line 2.
########
use abc;
EXPECT
Variable "$joe" is not imported at abc.pm line 2.
-Global symbol "joe" requires explicit package name at abc.pm line 2.
+Global symbol "$joe" requires explicit package name at abc.pm line 2.
Compilation failed in require at - line 2.
BEGIN failed--compilation aborted at - line 2.
########
print STDERR $@;
$joe = 1 ;
EXPECT
-Global symbol "joe" requires explicit package name at - line 6.
+Global symbol "$joe" requires explicit package name at - line 6.
Execution of - aborted due to compilation errors.
########
print STDERR $@;
$joe = 1 ;
EXPECT
-Global symbol "joe" requires explicit package name at - line 5.
+Global symbol "$joe" requires explicit package name at - line 5.
Execution of - aborted due to compilation errors.
########
$joe = 1 ;
EXPECT
Variable "$joe" is not imported at - line 9.
-Global symbol "joe" requires explicit package name at - line 9.
+Global symbol "$joe" requires explicit package name at - line 9.
Execution of - aborted due to compilation errors.
########
$joe = 1 ;
]; print STDERR $@;
EXPECT
-Global symbol "joe" requires explicit package name at (eval 1) line 3.
+Global symbol "$joe" requires explicit package name at (eval 1) line 3.
########
# Check scope of pragma with eval
$joe = 1 ;
'; print STDERR $@ ;
EXPECT
-Global symbol "joe" requires explicit package name at (eval 1) line 2.
+Global symbol "$joe" requires explicit package name at (eval 1) line 2.
########
# Check scope of pragma with eval
'; print STDERR $@;
$joe = 1 ;
EXPECT
-Global symbol "joe" requires explicit package name at - line 8.
+Global symbol "$joe" requires explicit package name at - line 8.
Execution of - aborted due to compilation errors.