http://qs321.pair.com?node_id=857784


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:

~$ 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.
What is going on here? am I just missing something? Thanks for the assist.