http://qs321.pair.com?node_id=317128


in reply to open vs. sysopen

I'd guess that there's no use POSIX; in the snippet. POSIX.pm is where the O_WRONLY, O_TRUNC and O_CREAT constants are defined.

If my guess is right, you also need to use strict; and use warnings; (see Use strict warnings and diagnostics or die for a good discussion of this), which would point you to the real error - the barewords, O_*.

Update: Strike obviously incorrect info