in reply to eval a command
The following code exists and the fork prints "Hello World" after the required 5 sec.
use strict ; use warnings ; my $cmd = 'sleep 5; print "Hello World\n";' ; my $pid = fork(); if (defined $pid && $pid == 0) { # child eval $cmd; } exit 0;
OS, Perl version and details on the command you are trying to execute might help
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: eval a command
by Xantara (Initiate) on Feb 21, 2013 at 14:56 UTC | |
by tmharish (Friar) on Feb 22, 2013 at 06:40 UTC | |
by marto (Cardinal) on Feb 22, 2013 at 09:54 UTC |