in reply to exec, system, or backticks
If you do something like:
`$swbt_dms $item > $log/$key`; $key = ...read file $log/$key...
Then you could simply do:
$key = `$swbt_dms $item`;
Otherwise, it's a waste to use `` when you discard the return value::
$key = system("$swbt_dms $item");
In Windows, you could also use Win32::Process and call $process->Wait().
exec is not appropriate since it doesn't return.
fork+exec, IPC::Open2, IPC::Open3, system 1, (Win32) and Win32::Process without $process->Wait() (Win32) are not appropriate since they create a process that runs in parallel.
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: exec, system, or backticks
by tc1364 (Beadle) on Oct 20, 2004 at 17:29 UTC | |
by ikegami (Patriarch) on Oct 20, 2004 at 17:33 UTC | |
by tc1364 (Beadle) on Oct 20, 2004 at 17:46 UTC | |
by kalle (Friar) on Oct 20, 2004 at 18:00 UTC | |
by tc1364 (Beadle) on Oct 20, 2004 at 18:10 UTC | |
by fstat(pipe) (Scribe) on Oct 21, 2004 at 22:56 UTC |