in reply to File Permission with open

I tried a different way by opening a process:
#!/usr/bin/perl use strict; use warnings; my $file = '/usr/local/tmp_files/temp_file_for_print.txt'; open (LPR, "| lpr -P/dev/lp"); print LPR $file; close(LPR);

Replies are listed 'Best First'.
Re^2: File Permission with open
by grungero (Initiate) on Oct 16, 2010 at 02:38 UTC
    Thanks, but if I'm not mistaken, there you only print the file. You assume that the file already exits...right?, But what I need is create the file, add some lines to the files and then print it. Like it has been said before, it's in the "open" part where I'm having the problem.
    Thanks for the answers, but I'm still suffering with this problem.