in reply to A problem with variables inside a system() call
No, perl should wait for the command to finish before it returns, and even if it didn't should build the entire shell command before executing it. Is this a multithreaded program? Can you give a snippet that actually reproduces the problem? I tried something simple like this:
and it worked as expected.$threshold=25; foreach $variable (23..30) { if ($variable < $threshold) { $command = '/bin/cat'; $UPDATE = `$command << EOF $variable is the value from DB. $variable is less than $threshold EOF`; print "Update: '$UPDATE'\n"; } }
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Re: A problem with variables inside a system() call
by sagat (Novice) on May 13, 2004 at 22:23 UTC | |
by sgifford (Prior) on May 13, 2004 at 22:29 UTC | |
by sagat (Novice) on May 13, 2004 at 22:42 UTC | |
by sgifford (Prior) on May 13, 2004 at 22:45 UTC |