|| IoIFP(io) == PerlIO_stderr()))
{
SV* sv = sv_newmortal();
- gv_efullname3(sv, gv, Nullch);
+ gv_efullname4(sv, gv, Nullch, FALSE);
Perl_warner(aTHX_ WARN_IO, "Filehandle %s opened only for output",
SvPV_nolen(sv));
}
#define gv_check Perl_gv_check
#define gv_efullname Perl_gv_efullname
#define gv_efullname3 Perl_gv_efullname3
+#define gv_efullname4 Perl_gv_efullname4
#define gv_fetchfile Perl_gv_fetchfile
#define gv_fetchmeth Perl_gv_fetchmeth
#define gv_fetchmethod Perl_gv_fetchmethod
#define gv_fetchpv Perl_gv_fetchpv
#define gv_fullname Perl_gv_fullname
#define gv_fullname3 Perl_gv_fullname3
+#define gv_fullname4 Perl_gv_fullname4
#define gv_init Perl_gv_init
#define gv_stashpv Perl_gv_stashpv
#define gv_stashpvn Perl_gv_stashpvn
#define gv_check(a) Perl_gv_check(aTHX_ a)
#define gv_efullname(a,b) Perl_gv_efullname(aTHX_ a,b)
#define gv_efullname3(a,b,c) Perl_gv_efullname3(aTHX_ a,b,c)
+#define gv_efullname4(a,b,c,d) Perl_gv_efullname4(aTHX_ a,b,c,d)
#define gv_fetchfile(a) Perl_gv_fetchfile(aTHX_ a)
#define gv_fetchmeth(a,b,c,d) Perl_gv_fetchmeth(aTHX_ a,b,c,d)
#define gv_fetchmethod(a,b) Perl_gv_fetchmethod(aTHX_ a,b)
#define gv_fetchpv(a,b,c) Perl_gv_fetchpv(aTHX_ a,b,c)
#define gv_fullname(a,b) Perl_gv_fullname(aTHX_ a,b)
#define gv_fullname3(a,b,c) Perl_gv_fullname3(aTHX_ a,b,c)
+#define gv_fullname4(a,b,c,d) Perl_gv_fullname4(aTHX_ a,b,c,d)
#define gv_init(a,b,c,d,e) Perl_gv_init(aTHX_ a,b,c,d,e)
#define gv_stashpv(a,b) Perl_gv_stashpv(aTHX_ a,b)
#define gv_stashpvn(a,b,c) Perl_gv_stashpvn(aTHX_ a,b,c)
#define gv_efullname Perl_gv_efullname
#define Perl_gv_efullname3 CPerlObj::Perl_gv_efullname3
#define gv_efullname3 Perl_gv_efullname3
+#define Perl_gv_efullname4 CPerlObj::Perl_gv_efullname4
+#define gv_efullname4 Perl_gv_efullname4
#define Perl_gv_fetchfile CPerlObj::Perl_gv_fetchfile
#define gv_fetchfile Perl_gv_fetchfile
#define Perl_gv_fetchmeth CPerlObj::Perl_gv_fetchmeth
#define gv_fullname Perl_gv_fullname
#define Perl_gv_fullname3 CPerlObj::Perl_gv_fullname3
#define gv_fullname3 Perl_gv_fullname3
+#define Perl_gv_fullname4 CPerlObj::Perl_gv_fullname4
+#define gv_fullname4 Perl_gv_fullname4
#define Perl_gv_init CPerlObj::Perl_gv_init
#define gv_init Perl_gv_init
#define Perl_gv_stashpv CPerlObj::Perl_gv_stashpv
Ap |void |gv_check |HV* stash
Ap |void |gv_efullname |SV* sv|GV* gv
Ap |void |gv_efullname3 |SV* sv|GV* gv|const char* prefix
+Ap |void |gv_efullname4 |SV* sv|GV* gv|const char* prefix|bool keepmain
Ap |GV* |gv_fetchfile |const char* name
Apd |GV* |gv_fetchmeth |HV* stash|const char* name|STRLEN len \
|I32 level
Ap |GV* |gv_fetchpv |const char* name|I32 add|I32 sv_type
Ap |void |gv_fullname |SV* sv|GV* gv
Ap |void |gv_fullname3 |SV* sv|GV* gv|const char* prefix
+Ap |void |gv_fullname4 |SV* sv|GV* gv|const char* prefix|bool keepmain
Ap |void |gv_init |GV* gv|HV* stash|const char* name \
|STRLEN len|int multi
Apd |HV* |gv_stashpv |const char* name|I32 create
}
void
+Perl_gv_fullname4(pTHX_ SV *sv, GV *gv, const char *prefix, bool keepmain)
+{
+ HV *hv = GvSTASH(gv);
+ if (!hv) {
+ (void)SvOK_off(sv);
+ return;
+ }
+ sv_setpv(sv, prefix ? prefix : "");
+ if (keepmain || strNE(HvNAME(hv), "main")) {
+ sv_catpv(sv,HvNAME(hv));
+ sv_catpvn(sv,"::", 2);
+ }
+ sv_catpvn(sv,GvNAME(gv),GvNAMELEN(gv));
+}
+
+void
Perl_gv_fullname3(pTHX_ SV *sv, GV *gv, const char *prefix)
{
HV *hv = GvSTASH(gv);
}
void
+Perl_gv_efullname4(pTHX_ SV *sv, GV *gv, const char *prefix, bool keepmain)
+{
+ GV *egv = GvEGV(gv);
+ if (!egv)
+ egv = gv;
+ gv_fullname4(sv, egv, prefix, keepmain);
+}
+
+void
Perl_gv_efullname3(pTHX_ SV *sv, GV *gv, const char *prefix)
{
GV *egv = GvEGV(gv);
#define Perl_gv_efullname3 pPerl->Perl_gv_efullname3
#undef gv_efullname3
#define gv_efullname3 Perl_gv_efullname3
+#undef Perl_gv_efullname4
+#define Perl_gv_efullname4 pPerl->Perl_gv_efullname4
+#undef gv_efullname4
+#define gv_efullname4 Perl_gv_efullname4
#undef Perl_gv_fetchfile
#define Perl_gv_fetchfile pPerl->Perl_gv_fetchfile
#undef gv_fetchfile
#define Perl_gv_fullname3 pPerl->Perl_gv_fullname3
#undef gv_fullname3
#define gv_fullname3 Perl_gv_fullname3
+#undef Perl_gv_fullname4
+#define Perl_gv_fullname4 pPerl->Perl_gv_fullname4
+#undef gv_fullname4
+#define gv_fullname4 Perl_gv_fullname4
#undef Perl_gv_init
#define Perl_gv_init pPerl->Perl_gv_init
#undef gv_init
if (!(io = GvIO(gv))) {
if (ckWARN(WARN_UNOPENED)) {
SV* sv = sv_newmortal();
- gv_efullname3(sv, gv, Nullch);
+ gv_efullname4(sv, gv, Nullch, FALSE);
Perl_warner(aTHX_ WARN_UNOPENED, "Filehandle %s never opened",
SvPV(sv,n_a));
}
if (ckWARN2(WARN_CLOSED, WARN_IO)) {
if (IoIFP(io)) {
SV* sv = sv_newmortal();
- gv_efullname3(sv, gv, Nullch);
+ gv_efullname4(sv, gv, Nullch, FALSE);
Perl_warner(aTHX_ WARN_IO,
"Filehandle %s opened only for input",
SvPV(sv,n_a));
|| fp == PerlIO_stderr()))
{
SV* sv = sv_newmortal();
- gv_efullname3(sv, PL_last_in_gv, Nullch);
+ gv_efullname4(sv, PL_last_in_gv, Nullch, FALSE);
Perl_warner(aTHX_ WARN_IO, "Filehandle %s opened only for output",
SvPV_nolen(sv));
}
else {
GV **gvp = (GV**)hv_fetch(hv, GvNAME(egv), GvNAMELEN(egv), FALSE);
if (gvp && *gvp == egv) {
- gv_efullname3(TARG, PL_defoutgv, Nullch);
+ gv_efullname4(TARG, PL_defoutgv, Nullch, FALSE);
XPUSHTARG;
}
else {
if (!cv) {
if (fgv) {
SV *tmpsv = sv_newmortal();
- gv_efullname3(tmpsv, fgv, Nullch);
+ gv_efullname4(tmpsv, fgv, Nullch, FALSE);
DIE(aTHX_ "Undefined format \"%s\" called",SvPVX(tmpsv));
}
DIE(aTHX_ "Not a format reference");
cv = GvFORM(fgv);
if (!cv) {
SV *tmpsv = sv_newmortal();
- gv_efullname3(tmpsv, fgv, Nullch);
+ gv_efullname4(tmpsv, fgv, Nullch, FALSE);
DIE(aTHX_ "Undefined top format \"%s\" called",SvPVX(tmpsv));
}
if (CvCLONE(cv))
if (ckWARN2(WARN_CLOSED,WARN_IO)) {
if (IoIFP(io)) {
SV* sv = sv_newmortal();
- gv_efullname3(sv, gv, Nullch);
+ gv_efullname4(sv, gv, Nullch, FALSE);
Perl_warner(aTHX_ WARN_IO,
"Filehandle %s opened only for input",
SvPV_nolen(sv));
sv = NEWSV(0,0);
if (!(io = GvIO(gv))) {
if (ckWARN(WARN_UNOPENED)) {
- gv_efullname3(sv, gv, Nullch);
+ gv_efullname4(sv, gv, Nullch, FALSE);
Perl_warner(aTHX_ WARN_UNOPENED,
"Filehandle %s never opened", SvPV(sv,n_a));
}
else if (!(fp = IoOFP(io))) {
if (ckWARN2(WARN_CLOSED,WARN_IO)) {
if (IoIFP(io)) {
- gv_efullname3(sv, gv, Nullch);
+ gv_efullname4(sv, gv, Nullch, FALSE);
Perl_warner(aTHX_ WARN_IO,
"Filehandle %s opened only for input",
SvPV(sv,n_a));
|| IoIFP(io) == PerlIO_stderr()) && ckWARN(WARN_IO))
{
SV* sv = sv_newmortal();
- gv_efullname3(sv, gv, Nullch);
+ gv_efullname4(sv, gv, Nullch, FALSE);
Perl_warner(aTHX_ WARN_IO, "Filehandle %s opened only for output",
SvPV_nolen(sv));
}
PERL_CALLCONV void Perl_gv_check(pTHX_ HV* stash);
PERL_CALLCONV void Perl_gv_efullname(pTHX_ SV* sv, GV* gv);
PERL_CALLCONV void Perl_gv_efullname3(pTHX_ SV* sv, GV* gv, const char* prefix);
+PERL_CALLCONV void Perl_gv_efullname4(pTHX_ SV* sv, GV* gv, const char* prefix, bool keepmain);
PERL_CALLCONV GV* Perl_gv_fetchfile(pTHX_ const char* name);
PERL_CALLCONV GV* Perl_gv_fetchmeth(pTHX_ HV* stash, const char* name, STRLEN len, I32 level);
PERL_CALLCONV GV* Perl_gv_fetchmethod(pTHX_ HV* stash, const char* name);
PERL_CALLCONV GV* Perl_gv_fetchpv(pTHX_ const char* name, I32 add, I32 sv_type);
PERL_CALLCONV void Perl_gv_fullname(pTHX_ SV* sv, GV* gv);
PERL_CALLCONV void Perl_gv_fullname3(pTHX_ SV* sv, GV* gv, const char* prefix);
+PERL_CALLCONV void Perl_gv_fullname4(pTHX_ SV* sv, GV* gv, const char* prefix, bool keepmain);
PERL_CALLCONV void Perl_gv_init(pTHX_ GV* gv, HV* stash, const char* name, STRLEN len, int multi);
PERL_CALLCONV HV* Perl_gv_stashpv(pTHX_ const char* name, I32 create);
PERL_CALLCONV HV* Perl_gv_stashpvn(pTHX_ const char* name, U32 namelen, I32 create);
close STDIN ; print STDIN "abc" ;
EXPECT
Reversed += operator at - line 5.
-print() on closed filehandle main::STDIN at - line 6.
+print() on closed filehandle STDIN at - line 6.
########
-W
# lint: check runtime $^W is zapped
$^W = 0 ;
close STDIN ; print STDIN "abc" ;
EXPECT
-print() on closed filehandle main::STDIN at - line 4.
+print() on closed filehandle STDIN at - line 4.
########
-W
# lint: check runtime $^W is zapped
close STDIN ; print STDIN "abc" ;
}
EXPECT
-print() on closed filehandle main::STDIN at - line 5.
+print() on closed filehandle STDIN at - line 5.
########
-W
# lint: check "no warnings" is zapped
close STDIN ; print STDIN "abc" ;
EXPECT
Reversed += operator at - line 5.
-print() on closed filehandle main::STDIN at - line 6.
+print() on closed filehandle STDIN at - line 6.
########
-W
# lint: check "no warnings" is zapped
close STDIN ; print STDIN "abc" ;
}
EXPECT
-print() on closed filehandle main::STDIN at - line 5.
+print() on closed filehandle STDIN at - line 5.
########
-Ww
# lint: check combination of -w and -W
close STDIN ; print STDIN "abc" ;
}
EXPECT
-print() on closed filehandle main::STDIN at - line 5.
+print() on closed filehandle STDIN at - line 5.
########
-W
--FILE-- abc.pm
no warnings 'io' ;
$a = eof STDOUT ;
EXPECT
-Filehandle main::STDOUT opened only for output at - line 3.
+Filehandle STDOUT opened only for output at - line 3.
no warnings 'unopened' ;
print $f $a;
EXPECT
-Filehandle main::abc never opened at - line 4.
+Filehandle abc never opened at - line 4.
########
# pp_hot.c [pp_print]
use warnings 'io' ;
no warnings 'io' ;
print STDIN "anc";
EXPECT
-Filehandle main::STDIN opened only for input at - line 3.
-Filehandle main::STDOUT opened only for output at - line 4.
-Filehandle main::STDERR opened only for output at - line 5.
-Filehandle main::FOO opened only for output at - line 6.
-Filehandle main::STDERR opened only for output at - line 7.
-Filehandle main::FOO opened only for output at - line 8.
+Filehandle STDIN opened only for input at - line 3.
+Filehandle STDOUT opened only for output at - line 4.
+Filehandle STDERR opened only for output at - line 5.
+Filehandle FOO opened only for output at - line 6.
+Filehandle STDERR opened only for output at - line 7.
+Filehandle FOO opened only for output at - line 8.
########
# pp_hot.c [pp_print]
use warnings 'closed' ;
opendir STDIN, ".";
print STDIN "anc";
EXPECT
-print() on closed filehandle main::STDIN at - line 4.
-print() on closed filehandle main::STDIN at - line 6.
- (Are you trying to call print() on dirhandle main::STDIN?)
+print() on closed filehandle STDIN at - line 4.
+print() on closed filehandle STDIN at - line 6.
+ (Are you trying to call print() on dirhandle STDIN?)
########
# pp_hot.c [pp_rv2av]
use warnings 'uninitialized' ;
opendir STDIN, "." ; $a = <STDIN> ;
$a = <STDIN> ;
EXPECT
-readline() on closed filehandle main::STDIN at - line 3.
-readline() on closed filehandle main::STDIN at - line 4.
- (Are you trying to call readline() on dirhandle main::STDIN?)
+readline() on closed filehandle STDIN at - line 3.
+readline() on closed filehandle STDIN at - line 4.
+ (Are you trying to call readline() on dirhandle STDIN?)
########
# pp_hot.c [Perl_do_readline]
use warnings 'io' ;
$a = <FH> ;
unlink $file ;
EXPECT
-Filehandle main::FH opened only for output at - line 5.
+Filehandle FH opened only for output at - line 5.
########
# pp_hot.c [Perl_sub_crush_depth]
use warnings 'recursion' ;
no warnings 'io' ;
write STDIN;
EXPECT
-Filehandle main::STDIN opened only for input at - line 5.
+Filehandle STDIN opened only for input at - line 5.
########
# pp_sys.c [pp_leavewrite]
use warnings 'closed' ;
opendir STDIN, ".";
write STDIN;
EXPECT
-write() on closed filehandle main::STDIN at - line 6.
-write() on closed filehandle main::STDIN at - line 8.
- (Are you trying to call write() on dirhandle main::STDIN?)
+write() on closed filehandle STDIN at - line 6.
+write() on closed filehandle STDIN at - line 8.
+ (Are you trying to call write() on dirhandle STDIN?)
########
# pp_sys.c [pp_leavewrite]
use warnings 'io' ;
no warnings 'unopened' ;
printf $a "fred";
EXPECT
-Filehandle main::abc never opened at - line 4.
+Filehandle abc never opened at - line 4.
########
# pp_sys.c [pp_prtf]
use warnings 'closed' ;
opendir STDIN, ".";
printf STDIN "fred";
EXPECT
-printf() on closed filehandle main::STDIN at - line 4.
-printf() on closed filehandle main::STDIN at - line 6.
- (Are you trying to call printf() on dirhandle main::STDIN?)
+printf() on closed filehandle STDIN at - line 4.
+printf() on closed filehandle STDIN at - line 6.
+ (Are you trying to call printf() on dirhandle STDIN?)
########
# pp_sys.c [pp_prtf]
use warnings 'io' ;
no warnings 'io' ;
printf STDIN "fred";
EXPECT
-Filehandle main::STDIN opened only for input at - line 3.
+Filehandle STDIN opened only for input at - line 3.
########
# pp_sys.c [pp_send]
use warnings 'closed' ;
opendir STDIN, ".";
syswrite STDIN, "fred", 1;
EXPECT
-syswrite() on closed filehandle main::STDIN at - line 4.
-syswrite() on closed filehandle main::STDIN at - line 6.
- (Are you trying to call syswrite() on dirhandle main::STDIN?)
+syswrite() on closed filehandle STDIN at - line 4.
+syswrite() on closed filehandle STDIN at - line 6.
+ (Are you trying to call syswrite() on dirhandle STDIN?)
########
# pp_sys.c [pp_flock]
use Config;
opendir STDIN, ".";
flock STDIN, 8;
EXPECT
-flock() on closed filehandle main::STDIN at - line 14.
-flock() on closed filehandle main::STDIN at - line 16.
- (Are you trying to call flock() on dirhandle main::STDIN?)
+flock() on closed filehandle STDIN at - line 14.
+flock() on closed filehandle STDIN at - line 16.
+ (Are you trying to call flock() on dirhandle STDIN?)
########
# pp_sys.c [pp_prtf pp_send pp_bind pp_connect pp_listen pp_accept pp_shutdown pp_ssockopt ppp_getpeername]
use warnings 'io' ;
getsockname STDIN;
getpeername STDIN;
EXPECT
-send() on closed socket main::STDIN at - line 22.
-bind() on closed socket main::STDIN at - line 23.
-connect() on closed socket main::STDIN at - line 24.
-listen() on closed socket main::STDIN at - line 25.
-accept() on closed socket main::STDIN at - line 26.
-shutdown() on closed socket main::STDIN at - line 27.
-setsockopt() on closed socket main::STDIN at - line 28.
-getsockopt() on closed socket main::STDIN at - line 29.
-getsockname() on closed socket main::STDIN at - line 30.
-getpeername() on closed socket main::STDIN at - line 31.
-send() on closed socket main::STDIN at - line 33.
- (Are you trying to call send() on dirhandle main::STDIN?)
-bind() on closed socket main::STDIN at - line 34.
- (Are you trying to call bind() on dirhandle main::STDIN?)
-connect() on closed socket main::STDIN at - line 35.
- (Are you trying to call connect() on dirhandle main::STDIN?)
-listen() on closed socket main::STDIN at - line 36.
- (Are you trying to call listen() on dirhandle main::STDIN?)
-accept() on closed socket main::STDIN at - line 37.
- (Are you trying to call accept() on dirhandle main::STDIN?)
-shutdown() on closed socket main::STDIN at - line 38.
- (Are you trying to call shutdown() on dirhandle main::STDIN?)
-setsockopt() on closed socket main::STDIN at - line 39.
- (Are you trying to call setsockopt() on dirhandle main::STDIN?)
-getsockopt() on closed socket main::STDIN at - line 40.
- (Are you trying to call getsockopt() on dirhandle main::STDIN?)
-getsockname() on closed socket main::STDIN at - line 41.
- (Are you trying to call getsockname() on dirhandle main::STDIN?)
-getpeername() on closed socket main::STDIN at - line 42.
- (Are you trying to call getpeername() on dirhandle main::STDIN?)
+send() on closed socket STDIN at - line 22.
+bind() on closed socket STDIN at - line 23.
+connect() on closed socket STDIN at - line 24.
+listen() on closed socket STDIN at - line 25.
+accept() on closed socket STDIN at - line 26.
+shutdown() on closed socket STDIN at - line 27.
+setsockopt() on closed socket STDIN at - line 28.
+getsockopt() on closed socket STDIN at - line 29.
+getsockname() on closed socket STDIN at - line 30.
+getpeername() on closed socket STDIN at - line 31.
+send() on closed socket STDIN at - line 33.
+ (Are you trying to call send() on dirhandle STDIN?)
+bind() on closed socket STDIN at - line 34.
+ (Are you trying to call bind() on dirhandle STDIN?)
+connect() on closed socket STDIN at - line 35.
+ (Are you trying to call connect() on dirhandle STDIN?)
+listen() on closed socket STDIN at - line 36.
+ (Are you trying to call listen() on dirhandle STDIN?)
+accept() on closed socket STDIN at - line 37.
+ (Are you trying to call accept() on dirhandle STDIN?)
+shutdown() on closed socket STDIN at - line 38.
+ (Are you trying to call shutdown() on dirhandle STDIN?)
+setsockopt() on closed socket STDIN at - line 39.
+ (Are you trying to call setsockopt() on dirhandle STDIN?)
+getsockopt() on closed socket STDIN at - line 40.
+ (Are you trying to call getsockopt() on dirhandle STDIN?)
+getsockname() on closed socket STDIN at - line 41.
+ (Are you trying to call getsockname() on dirhandle STDIN?)
+getpeername() on closed socket STDIN at - line 42.
+ (Are you trying to call getpeername() on dirhandle STDIN?)
########
# pp_sys.c [pp_stat]
use warnings 'newline' ;
close F ;
unlink $file ;
EXPECT
-Filehandle main::F opened only for output at - line 5.
+Filehandle F opened only for output at - line 5.
assert(gv);
sv = sv_newmortal();
- gv_efullname3(sv, gv, Nullch);
+ gv_efullname4(sv, gv, Nullch, FALSE);
name = SvPVX(sv);
Perl_warner(aTHX_ WARN_CLOSED, "%s() on closed %s %s", func, obj, name);