In my perl script I have a line like this.
system( "'/usr/bin/lp -dhp4si /tmp/plotreq.txt' > /tmp/plotid.txt");
hp4si is the destination printer.
/tmp/plotreq.txt is small text file to be sent to the printer.
/tmp/plotid.txt is the output of lp command ( just one line to indicate job
id )to be saved.
If I run the command /usr/bin/lp -dhp4si /tmp/plotreq.txt > /tmp/plotid.txt
it is fine as a command line.
The same in the perl script as above, doesn't send the file to printer nor
does it create the /tmp/plotid.txt file.
I have tried this also and did not work.
@lplist = ("/usr/bin/lp", "-dhp4si /tmp/plotreq.txt");
system(@lplist);
This is the context.
sub search {
some code
....
open(REQFILE, ">/tmp/plotreq.txt") || die "sorry, could not open
/tmp/plotreq.txt";
some more code to generate content for plotreq.txt
......
close(REQFILE);
.... This is where I tried the above to send the file to the printer.
}
This sub is part of a cgi script that creates output for the browser. The
browser output is OK.
The /tmp/plotreq.txt is generated but not being sent to the printer.
Can somebody guide me to do it right ?.
Thanks
Raj kairam