- or download this
sub foo {
my $self = shift;
...
open FH, $filename or die "Can not open file: $!\n";
$self->{'fh'} = \*FH;
}
- or download this
package FOO;
use diagnostics;
...
while ($data = $foo->read_line) {
$foo->write_line($data);
}
- or download this
KEY: out_fh VAL: GLOB(0x1a75098)
KEY: inp_fh VAL: GLOB(0x1a75038)
KEY: input VAL: inp.dat
KEY: blahh VAL: blah
KEY: output VAL: out.dat
- or download this
KEY: out_fh VAL: *FOO::FH
KEY: inp_fh VAL: *FOO::FH
- or download this
sub _open_write {
my $self = shift;
...
open $fh, ">$self->{'output'}" or die "Couldn't open file: $!\n";
return $fh;
}