use strict; use FileHandle; STDOUT->autoflush(1); #$| = 1; my $text = "Printing test...\n"; open FH, ">LPT1:"; print FH "$text\n";