in reply to Re: Printing to a File from Sub
in thread Printing to a File from Sub
here is code I am trying to use:
#!/usr/bin/perl use strict; use warnings; open my $fhout, '>', "./test_out.file" || die "$!"; &test_print($fhout); sub test_print{ my $fhout = @_; print {$fhout} "this is a test\n"; } close $fhout;
and here is the error message I keep getting:
What is going on here? am I just missing something? Thanks for the assist.~$ perl test_write.pl Can't use string ("1") as a symbol ref while "strict refs" in use at t +est_write.pl line 11.
|
---|
Replies are listed 'Best First'. | |
---|---|
Re^3: Printing to a File from Sub
by choroba (Cardinal) on Aug 30, 2010 at 16:47 UTC | |
Re^3: Printing to a File from Sub
by pemungkah (Priest) on Aug 29, 2010 at 00:50 UTC | |
by choroba (Cardinal) on Aug 30, 2010 at 16:50 UTC | |
by suaveant (Parson) on Aug 30, 2010 at 19:33 UTC |
In Section
Seekers of Perl Wisdom