Use the CHILD_ERROR $? to see what happend, for example
system(" some command ");
if ( $? )
{
....then figure out what happend..
}
Note that you'll have to see what your command returns and parse that.
See perlvar(1), there is some shifting around to be done as well.
But I am not sure how this is related to ModPerl?
On Fri, 30 Nov 2001, Kairam, Raj wrote:
> 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
>
>
--
-------------------------------------------------------------------------
Medi Montaseri [EMAIL PROTECTED]
Unix Distributed Systems Engineer HTTP://www.CyberShell.com
CyberShell Engineering
-------------------------------------------------------------------------