H
Hartmut Camphausen
Hi all,
Consider this snippet:
#!perl.exe -w
use strict;
my $f = 'abc';
my $fref = \$f;
my $fh;
warn "(0) $!" if $!;
open ($fh, '<', $fref) || die $!
warn "(1) $!" if $!;
print "\n", <$fh>;
seek ($fh, 1, 0) || die $!;
print "\n", <$fh>;
It produces this output:
(1) Bad file descriptor at E:\[Public]\cgi-bin\lib\Text\testmisc.pl
line 10.
abc
bc
Tool completed successfully
Any idea, why open() generates an error ($! set) without failing?
open() dies correctly if I dereference $fref via $$fref (No such
file...).
I'm running Perl v5.8.8.
Clueless,
H.
Consider this snippet:
#!perl.exe -w
use strict;
my $f = 'abc';
my $fref = \$f;
my $fh;
warn "(0) $!" if $!;
open ($fh, '<', $fref) || die $!
warn "(1) $!" if $!;
print "\n", <$fh>;
seek ($fh, 1, 0) || die $!;
print "\n", <$fh>;
It produces this output:
(1) Bad file descriptor at E:\[Public]\cgi-bin\lib\Text\testmisc.pl
line 10.
abc
bc
Tool completed successfully
Any idea, why open() generates an error ($! set) without failing?
open() dies correctly if I dereference $fref via $$fref (No such
file...).
I'm running Perl v5.8.8.
Clueless,
H.