in reply to HowTo retrieve the position in a file from the FH
You'd have a lot less trouble if you just used standard filehandles and related functions docuemented in perlfunc, rather than faffing around with those pseudo-object modules that each have their own and slightly different view of things and how things "should work".
open my $fh, '<', $file or die $!; binmode $fh; my $binrec; read $fh, $binrec, 15; my $pos = tell $fh; print "pos = $pos\n"; ## prints 'pos = 15' .... seek $fh, $pos, SEEK_SET; ## go back
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: HowTo retrieve the position in a file from the FH
by Tanktalus (Canon) on Mar 13, 2006 at 17:28 UTC | |
by BrowserUk (Patriarch) on Mar 13, 2006 at 17:45 UTC |