in reply to system() not waiting

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"));