in reply to open vs sysopen

As stated before sysopen comes with more precision than open.

sysopen helps avoiding race-conditions.

Consider the following snippet:

if (-e $file) { open(FH,">","$file") or die $!; }

It's a two step process:

  1. File test
  2. open

sysopen needs only one step (kind a simplistic, but you should get the message).

use Fcntl; sysopen(FH, $file, O_WRONLY|O_TRUNC|O_CREAT, 0600) or die $!;

HTH,
Thomas