use File::Temp qw/tempfile/; my ($tfh,$tfn) = tempfile(UNLINK=>1); print $tfh "Some Data...\n"; close $tfh; $printer->printFile($tfn, 'jobx')