in reply to open vs. sysopen
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
In Section
Seekers of Perl Wisdom