in reply to Re^3: modules, exporting, and indirect filehandles
in thread modules, exporting, and indirect filehandles

With 5.6, there's no need to use gensym() either:

sub open_file { my ($mode, $file) = @_; open my $fh, $mode, $file or croak("Could not open '$file': $! +"); return $fh; }

Replies are listed 'Best First'.
Re^5: modules, exporting, and indirect filehandles
by ikegami (Patriarch) on Aug 09, 2005 at 20:35 UTC
    I know. You just duplicated my first reply (except mine also supports the two-arg open). The OP stated he didn't want to use that.