in reply to Using File Reference
I don't see any immediate error in your code, but here's a couple of things to think about. First, check the status of your open. If you failed to open the file, printing to the file will silently fail.
sub setDestFile { my($self, $file) = @_; local(*F); open( F, ">$file") or die "Cannot open $file for writing: $!"; $fh = \*F; $self->{'destfile'} = $fh; }
Next, munge your contructor to print a header right away. If the open is successful and you don't print a header (you can add an a die to print, also), then you know where to look for the problem.
Lastly, in &output, print $text somewhere where you can see it (STDOUT or STDERR come to mind) in order to verify that you are actually passing something.
Cheers,
Ovid
Join the Perlmonks Setiathome Group or just click on the the link and check out our stats.
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: (Ovid) Re: Using File Reference
by Anonymous Monk on Apr 05, 2002 at 18:26 UTC | |
by danboo (Beadle) on Apr 05, 2002 at 20:29 UTC |