in reply to Re: CUPS Printing - Using a Variable as a Filename
in thread CUPS Printing - Using a Variable as a Filename

open($filehandle, '>', $filename) or die "Cannot open file for writing +: $!\n"; ... open($filehandle, '<', $filename) or die "Cannot open file for reading +: $!\n"; close($filehandle);

Note you can remove these lines - tempfile and printFile do this for you. (The first close($filehandle) is still required, but not the second.)