Beefy Boxes and Bandwidth Generously Provided by pair Networks Bob
Clear questions and runnable code
get the best and fastest answer
 
PerlMonks  

Re (tilly) 3: Two-arg open() considered dangerous

by tilly (Archbishop)
on Dec 12, 2001 at 03:54 UTC ( #131112=note: print w/ replies, xml ) Need Help??


in reply to Re (chip): Two-arg open() considered dangerous
in thread Two-arg open() considered dangerous

It is not guaranteed. From 'perldoc -f sysopen' on 5.005_03 I get:

=item sysopen FILEHANDLE,FILENAME,MODE =item sysopen FILEHANDLE,FILENAME,MODE,PERMS [ snip ] The possible values and flag bits of the MODE parameter are system-dependent; they are available via the standard module C<Fcntl>. For historical reasons, some values work on almost every system supported by perl: zero means read-only, one means write-only, and two means read/write. We know that these values do I<not> work under OS/390 & VM/ESA Unix and on the Macintosh; you probably don't want to use them in new code.
So those values probably work. But not always.


Comment on Re (tilly) 3: Two-arg open() considered dangerous
Download Code
Re (chip): Two-arg open() considered dangerous
by chip (Curate) on Dec 12, 2001 at 03:58 UTC
    Damn. I had no idea that there were systems that broken that could still run a modern Perl.

        -- Chip Salzenberg, Free-Floating Agent of Chaos

      Either way, it's more readable with the explicit constant names exported by Fcntl, which is good for all those coders coming to your code from a two-arg open() mentality/background.

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others romping around the Monastery: (5)
As of 2014-04-20 14:31 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    April first is:







    Results (485 votes), past polls