in reply to Error in CGI::Session on Windows: flock() not implemented

What Perl installation are you using on Windows (ActiveState...what version?) and can you run the following code (taken from the perldoc):
use Fcntl ':flock'; # import LOCK_* constants sub lock { flock(MBOX,LOCK_EX); # and, in case someone appended # while we were waiting... seek(MBOX, 0, 2); } sub unlock { flock(MBOX,LOCK_UN); } open(MBOX, ">>/usr/spool/mail/$ENV{'USER'}") or die "Can't open mailbox: $!"; lock(); print MBOX $msg,"\n\n"; unlock();

Celebrate Intellectual Diversity

Replies are listed 'Best First'.
Re^2: Error in CGI::Session on Windows: flock() not implemented
by sara2005 (Scribe) on Dec 12, 2005 at 19:32 UTC
    I am using version 5.6.1

    code you gave doesn't work. It fails with message 'Can't open mailbox: no file or directory" because I am trying this in windows and it can't find '/usr/spool/mail...'

      Sorry, I suppose I should have told you to revise the file path to something that exists on your machine (probably c:\\temp\\something_or_other.txt). Revise and try and see if it dies on the flock() call. Update: Why aren't you using a newer version of Perl?

      Celebrate Intellectual Diversity

        Thanks for the update.

        I tried changing the script as you suggested. I get this message "flock() unimplemented on this paltform".

        I am runnign this on windows 98SE. Is that the cause of this error?

        Thanks for the update.

        I tried changing the script as you suggested. I get this message "flock() unimplemented on this paltform".

        I am using perl 5.6.1 to be consistent with the version I have in Unix ( I don't have admin privileges in Unix to install the latest version)

        I am running this on windows 98SE. Is that the cause of this error?