in reply to flock with FileHandle.pm?

From my experience, flock() methods are exported from the Fcntl module which calls on OS-specific methods. For example:
 
#!/usr/bin/perl use FileHandle; use Fcntl ':flock'; # Create file handle and open file for writing # my $fh = new FileHandle; if ($fh->open(">file")) { # Obtain an exclusive lock on the file handle # flock ($fh, LOCK_EX); # Write to file handle # print $fh "Just another Perl hacker\n"; # Remove exclusive lock on file handle and close file handle # flock ($fh, LOCK_UN); $fh->close; } exit 0;

 
Update : It turns out that the Fcntl usage only imports the LOCK_EX and LOCK_UN constants, not provides the flock() method - Thanks tilly :)
 

 
Ooohhh, Rob no beer function well without!