in reply to Re^2: Having Access to a file two times
in thread Having Access to a file two times

No: you need to specify a filehandle.
seek FH, 0, 1;
Take another look at the seek docs.

It's also nice to check the return status of the file operation for success:

seek FH, 0, 1 or die "seek failed: $!";

Replies are listed 'Best First'.
Re^4: Having Access to a file two times
by oxone (Friar) on Sep 21, 2008 at 10:00 UTC
    You mean ..
    seek FH, 0, 0;
    .. assuming the aim is to rewind back to the start.

      Or even better:

      use Fcntl qw/:seek/; seek FH, 0, SEEK_SET or die "Cannot seek on $filename: $!";
      Quite right!   Looks like I need to take another look at the seek docs.