Perl-Sensitive Sunglasses | |
PerlMonks |
open() enhancementsby John M. Dlugosz (Monsignor) |
on Aug 21, 2002 at 19:43 UTC ( [id://191852]=perlmeditation: print w/replies, xml ) | Need Help?? |
<muse> The open() function doesn't provide for security, sharing modes, and lots of OS-specific hints and modes. I remember the (pre-standard) C language adding an sopen that took sharing-mode parameters, but that isn't elegant. I think what Perl needs, in the spirit of Perl, is text-based options inside the filename parameter, just like the cool stuff that's there already. As well as > < | & and whatever else, it could take platform-dependant flags, too. So if we use ++>> as the delimiter, perhaps open (FH, "<foo.out ++>> sequential) would be used to indicate that the file was going to be used for sequential access (not random access) if that "hint" is possible to the underlying OS. Since it's part of the string, I'm not too broken up about having platform-dependant stuff in there. </muse> —John
Back to
Meditations
|
|