in reply to sysopen vs. open

Perl's open is equivalent to C's fopen and Perl's sysopen is equivalent to C's open.

Replies are listed 'Best First'.
Re^2: sysopen vs. open
by bichonfrise74 (Vicar) on May 15, 2009 at 00:25 UTC
    I'm not very familiar with C. So, I have to ask... in which situation is open better than sysopen or vice-versa?
      At a command prompt type perldoc -f sysopen and perldoc -f open. Or compare them on http://perldoc.perl.org/index-functions.html.

      My summary is that sysopen is a lower-level interface that can't ever be removed because of backwards compatibility, while open is the one that I would suggest people use.

Re^2: sysopen vs. open
by ikegami (Patriarch) on Apr 18, 2020 at 09:27 UTC

    Not so. Both create buffered handles like fopen(3), not mere file descriptors like open(2)

    The difference is the args you can pass to them.

Re^2: sysopen vs. open
by JavaFan (Canon) on May 15, 2009 at 22:01 UTC
    That's not complete. Perl's open is equivalent to the union of C's fopen and popen.