use warnings; use strict; my $type = 123; my $FH; open ($FH, '>', 'out.txt'); print $FH ("start" . $type . "end"); close $FH;