I agree that three-arg open is a bit new to depend on, but
sysopen may not be inconvenient. Specifically,
it's guaranteed{1} that
O_RDONLY,
O_WRONLY, and
O_RDWR have the values
zero, one, and two, respectively. So
sysopen FOO, $file, 0
should work everywhere in the known universe.
{1} This is OK to count on because the C function open()
originates with Unix, and for backwards compatibility with
ancient UNIX code, the second parameter of open() must accept
zero/one/two.
-- Chip Salzenberg, Free-Floating Agent of Chaos