if (result == EOF && fd > PL_maxsysfd) {
/* Why is this not Perl_warn*() call ? */
PerlIO_printf(Perl_error_log,
- "Warning: unable to close filehandle %s properly.\n",
- GvENAME(gv));
+ "Warning: unable to close filehandle %"SVf" properly.\n",
+ SVfARG(sv_2mortal(newSVhek(GvENAME_HEK(gv)))));
}
IoOFP(io) = IoIFP(io) = NULL;
}
if ((IoTYPE(io) == IoTYPE_RDONLY) &&
(fp == PerlIO_stdout() || fp == PerlIO_stderr())) {
Perl_warner(aTHX_ packWARN(WARN_IO),
- "Filehandle STD%s reopened as %s only for input",
+ "Filehandle STD%s reopened as %"SVf" only for input",
((fp == PerlIO_stdout()) ? "OUT" : "ERR"),
- GvENAME(gv));
+ SVfARG(sv_2mortal(newSVhek(GvENAME_HEK(gv)))));
}
else if ((IoTYPE(io) == IoTYPE_WRONLY) && fp == PerlIO_stdin()) {
Perl_warner(aTHX_ packWARN(WARN_IO),
- "Filehandle STDIN reopened as %s only for output",
- GvENAME(gv));
+ "Filehandle STDIN reopened as %"SVf" only for output",
+ SVfARG(sv_2mortal(newSVhek(GvENAME_HEK(gv)))));
}
}
return PL_laststatval;
}
if (ckWARN(WARN_IO)) {
- Perl_warner(aTHX_ packWARN(WARN_IO), "Use of -l on filehandle %s",
- GvENAME(cGVOP_gv));
+ Perl_warner(aTHX_ packWARN(WARN_IO), "Use of -l on filehandle %"SVf,
+ SVfARG(sv_2mortal(newSVhek(GvENAME_HEK(cGVOP_gv)))));
}
return (PL_laststatval = -1);
}
EXPECT
Use of -l on filehandle STDIN at - line 3.
########
+# doio.c [Perl_my_stat]
+# TODO ? 1 ? "Scalar filehandles aren't yet clean" : ''
+use utf8;
+use open qw( :utf8 :std );
+use warnings 'io';
+-l $ᶠᚻ;
+open $ᶠᚻ, $0 or die "# $!";
+-l $ᶠᚻ;
+no warnings 'io';
+-l $ᶠᚻ;
+close $ᶠᚻ;
+EXPECT
+Use of -l on filehandle $ᶠᚻ at - line 7.
+########
# doio.c [Perl_do_aexec5]
use warnings 'io' ;
exec "lskdjfalksdjfdjfkls","" ;
########
# doio.c [Perl_do_openn]
use Config;
+use utf8;
+use open qw( :utf8 :std );
+BEGIN {
+ if (!$Config{useperlio}) {
+ print <<EOM;
+SKIPPED
+# warns only with perlio
+EOM
+ exit;
+ }
+}
+use warnings 'io' ;
+close STDOUT;
+open ᶠᚻ1, "../harness"; close ᶠᚻ1;
+no warnings 'io' ;
+open ᶠᚻ2, "../harness"; close ᶠᚻ2;
+EXPECT
+Filehandle STDOUT reopened as ᶠᚻ1 only for input at - line 16.
+########
+# doio.c [Perl_do_openn]
+use Config;
BEGIN {
if (!$Config{useperlio}) {
print <<EOM;
unlink "doiowarn.tmp";
EXPECT
Filehandle STDIN reopened as $fh1 only for output at - line 14.
+########
+# doio.c [Perl_do_openn]
+# TODO ? 1 ? "Scalar filehandles aren't yet clean" : ''
+use Config;
+use utf8;
+use open qw( :utf8 :std );
+BEGIN {
+ if (!$Config{useperlio}) {
+ print <<EOM;
+SKIPPED
+# warns only with perlio
+EOM
+ exit;
+ }
+}
+use warnings 'io' ;
+close STDIN;
+open my $ᶠᚻ1, ">doiowarn.tmp"; close $ᶠᚻ1;
+no warnings 'io' ;
+open my $ᶠᚻ2, ">doiowarn.tmp"; close $ᶠᚻ2;
+unlink "doiowarn.tmp";
+EXPECT
+Filehandle STDIN reopened as $ᶠᚻ1 only for output at - line 16.
+########
+# doio.c [Perl_do_openn]
+use Config;
+use utf8;
+use open qw( :utf8 :std );
+BEGIN {
+ if (!$Config{useperlio}) {
+ print <<EOM;
+SKIPPED
+# warns only with perlio
+EOM
+ exit;
+ }
+}
+use warnings 'io' ;
+close STDIN;
+open ᶠᚻ1, ">doiowarn.tmp"; close ᶠᚻ1;
+no warnings 'io' ;
+open ᶠᚻ2, ">doiowarn.tmp"; close ᶠᚻ2;
+unlink "doiowarn.tmp";
+EXPECT
+Filehandle STDIN reopened as ᶠᚻ1 only for output at - line 16.