I see, at least in the first call, that you are passing
a URL. Do any of the variables passed in contain & ?
system() with a single argument will call
the shell which will interpret the & to mean background
the process. If that happens system()
will return straight away.
The solution is to use the multi-arg system(),
but in the first instance you also want to redirect, so
you may have to fork() and exec()
Something like
my $pid = fork();
if ($pid) {
wait($pid); # Plus appropriate checking
}
elsif(defined($pid)) {
open(STDOUT,">$temp$file")
or die "Cannot open $temp$file: $!\n";
exec(qw("/3rdparty/perl/bin/sunos5/lwp-request -p http://proxy-syr
+.global.lmco.com),"$hostname$url","-C","$user:$password");
die "Cannot exec: $!\n";
}
else {
die "Cannot fork: $!\n";
}
system(qw(chmod 777),"$temp$file");
system(qw(acroread -toPostScript),"$temp$file");
system(qw(lp -d ep5_hpp01), $temp, glob("*.ps"));
Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
Read Where should I post X? if you're not absolutely sure you're posting in the right place.
Please read these before you post! —
Posts may use any of the Perl Monks Approved HTML tags:
- a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
| |
For: |
|
Use: |
| & | | & |
| < | | < |
| > | | > |
| [ | | [ |
| ] | | ] |
Link using PerlMonks shortcuts! What shortcuts can I use for linking?
See Writeup Formatting Tips and other pages linked from there for more info.