in reply to Question on seek()

Perhaps you did not import SEEK_END and you did not use warnings?
use Fcntl ':seek'; ... # your code here
Boris

Replies are listed 'Best First'.
Re^2: Question on seek()
by Joe_Cullity (Beadle) on Aug 04, 2005 at 19:29 UTC
    Thanks Boris that worked fine. One of the things that throws me using Perl vs C/C++ is that C/C++ always mentions what includes you need, but I don't see any equivelent in perl to let you know what "use" moduals one needs to request.
      but I don't see any equivelent in perl to let you know what "use" moduals one needs to request.
      From the perl documentation for seek:
      For WHENCE you may use the constants "SEEK_SET", "SEEK_CUR", and "SEEK_END" (start of the file, current position, end of the file) from the Fcntl module.

      Dave.

      Hmm my C does not. It just tells that something is missing. perl does this also with warnings enabled. Start any of you scripts with:
      use strict; use warnings;
      I learned about the constants for seek from the docs of seek.
      Boris