I'm trying to use getpos
in Perl. I am using a FileHandle
object in the code below, and it doesn't seem to be working. Can anyone tell me what I'm doing wrong?
use strict;
use warnings;
use FileHandle;
my $fh = new FileHandle;
$fh->open("<test.txt") or die "$!";
my $pos = $fh->getpos;
print "pos: \"$pos\"\n";
The output is:
pos: ""
I would expect "0" to be output...