The amount of code I get to save by having this in the module is awesome. And, thus, the number of bugs I'll have in this code will be darned few. Approaching zero the second time I use it.sub get_file { my $self = shift; my $filename = shift; my $outputdir = shift; my $ofh = IO::File->new(File::Spec->catfile($outputdir, $filename), +'w'); $self->get_filehandle($ofh); }
Redundant is writing the above 12 times rather than having a single sub doing it for me.
In reply to Re^4: Should Modules Do I/O?
by Tanktalus
in thread Should Modules Do I/O?
by pboin
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |