mmccaws2> Hi
mmccaws2> On unix I'll run a command at the command line like
mmccaws2> how do I do this from within a script?
open AT, "|at now + 2 minutes" or die $!;
print AT "./trial.pl"; # not sure why you backgrounded that.
close AT;
Or, if you don't really need "at", and you just want to execute something
in two minutes, you can simply fork:
defined(my $kid = fork) or die "Cannot fork: $!";
unless ($kid) { # child does...
sleep 2 * 60; # two minutes, measured in seconds
exec "./trial.pl"; # for example, or just do it in line
exit 0;
}
$kid's pid will show up on a waitpid() call later, so you need to wait for it
eventually or exit soon, or you can double fork and wait if you don't want the
zombie.
print "Just another Perl hacker,"; # the original, #0