in reply to What is wrong with my File open?

It is very likely that you are simply failing to use Fcntl, which is where your constants (O_CREAT, etc.) are defined. If you don't already have it, put

use Fcntl;
somewhere (probably near the top) in your script and that should take care of it for you.

Update: Here's a demo showing that this is possibly the problem:

500,0 sauoq@fozzie:~$ perl -e 'sysopen(OH, "./foo", O_CREAT) or die $! +' No such file or directory at -e line 1. 501,2 sauoq@fozzie:~$ perl -MFcntl -e 'sysopen(OH, "./foo", O_CREAT) o +r die $!' 502,0 sauoq@fozzie:~$

-sauoq
"My two cents aren't worth a dime.";

Replies are listed 'Best First'.
Re^2: What is wrong with my File open?
by inhistime (Initiate) on Nov 19, 2005 at 03:09 UTC
    Thank you so much your replies.
    Since I am new to PERL, I did not know I needed to put "use Fcntl".
    Now, it is working fine!
    Thanks, all of you.
    Myung
      Perl, not PERL.

      Can you articulate why you are using sysopen instead of open?