use Win32::API; my $shellopen = new Win32::API("shell32", "ShellExecute", ['N', 'P', 'P', 'P', 'P', 'I'], 'N'); sub printFile { my $filename = shift; if ($shellopen) { $shellopen->Call(0, "print", $filename, 0, 0, 0); print "Printing $filename...\n"; } }