in reply to Console output != file output
Tip #1 from the Basic debugging checklist: warnings
print() on closed filehandle FH at
You are opening the file for input, not output: see open. This works for me:
use warnings; use strict; my $type = 123; open (FH, '>out.txt'); print FH "start" . $type . "end"; close FH;
In Section
Seekers of Perl Wisdom