#!/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; #### ~$ perl test_write.pl Can't use string ("1") as a symbol ref while "strict refs" in use at test_write.pl line 11.