in reply to Re: modules, exporting, and indirect filehandles
in thread modules, exporting, and indirect filehandles
file:sub open_file { my ($mode, $file) = @_; my $fh = gensym(); open $fh, "$mode$file" or croak("could not open '$file': $!"); return \*$fh; }
why will this not work?my $LOG = open_file('<','log.txt'); while(<$LOG>) { print; }
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^3: modules, exporting, and indirect filehandles
by ikegami (Patriarch) on Aug 09, 2005 at 20:23 UTC | |
by chromatic (Archbishop) on Aug 09, 2005 at 20:31 UTC | |
by ikegami (Patriarch) on Aug 09, 2005 at 20:35 UTC | |
by eff_i_g (Curate) on Aug 09, 2005 at 21:11 UTC | |
|
Re^3: modules, exporting, and indirect filehandles
by eff_i_g (Curate) on Aug 09, 2005 at 20:19 UTC |