Todd C. Miller [Fri, 21 Apr 2000 10:43:46 +0000 (04:43 -0600)]
Subject: [ID
20000421.003] perlfunc says you can lstat a file handle but you cannot
Message-Id: <
200004211643.e3LGhkX24720@xerxes.courtesan.com>
p4raw-id: //depot/perl@6524
to check the return value of your socket() call? See
L<perlfunc/listen>.
+=item lstat() on filehandle %s
+
+(W io) You tried to do a lstat on a filehandle. What did you mean
+by that? lstat() makes sense only on filenames. (Perl did a fstat()
+instead on the filehandle.)
+
=item Lvalue subs returning %s not implemented yet
(F) Due to limitations in the current implementation, array and hash
See also L</exp> for the inverse operation.
-=item lstat FILEHANDLE
-
=item lstat EXPR
=item lstat
if (PL_op->op_flags & OPf_REF) {
tmpgv = cGVOP_gv;
+ if (PL_op->op_type == OP_LSTAT && ckWARN(WARN_IO))
+ Perl_warner(aTHX_ WARN_IO,
+ "lstat() on filehandle %s", GvENAME(tmpgv));
do_fstat:
if (tmpgv != PL_defgv) {
PL_laststype = OP_STAT;
close STDIN;
flock STDIN, 8;
+ lstat() on filehandle %s [pp_stat]
+ lstat(STDIN);
+
warn(warn_nl, "stat"); [pp_stat]
-T on unopened filehandle %s
EXPECT
Unsuccessful stat on filename containing newline at - line 3.
########
+# pp_sys.c [pp_stat]
+use Config;
+BEGIN {
+ if ($^O eq 'd_lstat') {
+ print <<EOM ;
+SKIPPED
+# lstat not present
+EOM
+ exit ;
+ }
+}
+use warnings 'io' ;
+lstat(STDIN) ;
+no warnings 'io' ;
+lstat(STDIN) ;
+EXPECT
+lstat() on filehandle STDIN at - line 13.
+########
# pp_sys.c [pp_fttext]
use warnings 'unopened' ;
close STDIN ;