Beefy Boxes and Bandwidth Generously Provided by pair Networks
Keep It Simple, Stupid
 
PerlMonks  

Re: open vs. sysopen

by jsprat (Curate)
on Dec 26, 2003 at 21:37 UTC ( [id://317128]=note: print w/replies, xml ) Need Help??


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

Replies are listed 'Best First'.
strict, warnings, die...
by sheep (Chaplain) on Dec 26, 2003 at 23:55 UTC
    I do use both: use warnings; and use strict;.
    Even though I was using $! to get the error message, I changed ascii_error() to die() supplying the full error in a reply to one of the posts above. As to the rest of the suggestions the previous reply to your post explains me.

    Thanks,
    -sheep

Re: Re: open vs. sysopen
by Anonymous Monk on Dec 26, 2003 at 21:48 UTC
    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.

    A poor guess. The code shown in the original post clearly has use Fcntl, which by default will export all system F_* and O_* constants.

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://317128]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others having an uproarious good time at the Monastery: (5)
As of 2024-04-25 16:55 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found