in reply to CUPS Printing - Using a Variable as a Filename

$printer->printFile($fh, 'jobx')

The documentation says that printFile wants a filename, not a handle. An in-memory file like this one does not have a filename. You probably want to use File::Temp instead (more examples):

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

Update: And as I mentioned here, you can use the DIR parameter, and as others have mentioned, you can point that at a RAM disk or similar file system.