adam2000 has asked for the wisdom of the Perl Monks concerning the following question:

From what I understand after reading various docs, the 'flock()' function is not supported on all platforms. I also understand that if 'flock()' is called on an unsupported system that a fatal error will occur. Would it be possible to include in my script, a test for the 'flock()' function (maybe using an 'eval'?) so that if it is supported a 'true' indicator is returned otherwise a 'false' indicator is returned? Can anyone show me the code to do this? Thanks, Adam

Replies are listed 'Best First'.
Re: Test Flock support
by cLive ;-) (Prior) on May 13, 2002 at 05:15 UTC
    Yes you can. Here's the flock and eval docs. Have a go and post your code if you can't get it to work.

    Hint - perhaps test a file lock and read on the running script - look at %ENV keys for relevant key name.

    cLive ;-)

    --
    seek(JOB,$$LA,0);