in reply to Re: Trouble making my own open()-like routines.
in thread Trouble making my own open()-like routines.

I think this is a case where the * prototype is justified. The OP is using it (in conjunction with Symbol::qualify_to_ref) correctly.

With a space after the > or >+, two arg open is safe.

  • Comment on Re^2: Trouble making my own open()-like routines.

Replies are listed 'Best First'.
Re^3: Trouble making my own open()-like routines.
by William G. Davis (Friar) on Jul 07, 2004 at 23:53 UTC

    I'd much prefer to use the three-argument version of open, but sadly, my target platform is Perl 5.005 and the three-argument version of open was introduced with 5.6.1.

    I also don't want to die in the routines themselves because that would limit the amount of information in the error messages. Far better to let the caller handle it, so they can do stuff like this:

    openFileForWriting($fh, 'file.log') or die "Couldn't open log file to store the crash report: $!";