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
In reply to Re: eval a command
by tmharish
in thread eval a command
by Xantara
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |