Beefy Boxes and Bandwidth Generously Provided by pair Networks
Problems? Is your data what you think it is?
 
PerlMonks  

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

by InfiniteSilence (Curate)
on Dec 12, 2005 at 19:13 UTC ( [id://516116]=note: print w/replies, xml ) Need Help??


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?

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://516116]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others avoiding work at the Monastery: (3)
As of 2024-04-20 09:58 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found