Hello,
I am relearning Perl after about 10 years of non use.
I did a copy and paste of the two scripts below from one of the answers for a similar question on this site. I have checked and double checked the 'path' and tried several deviations, but I still get the same answer -'The system cannot find the path specified'. Any help would be greatly appreciated!
It does get to the "starting child process" and the exits with the error message 'The system cannot find the path specified.'
Below is the cut and past of the original two scripts
parent.pl:
#!/usr/bin/perl
use warnings;
use Win32;
use Win32::Process;
$| = 1;
my $p;
print "Starting child process ... \n";
Win32::Process::Create(
$p,
'c:\Perl\perl.exe',
'perl hello.pl',
1,
NORMAL_PRIORITY_CLASS,
'.',
) or die Win32::FormatMessage( Win32::GetLastError() );
print "Waiting three seconds before killing 'hello.pl'\n";
for (1 .. 3) {
print;
sleep 1;
}
$p->Kill(0)
or die "Cannot kill '$p'";
hello.pl
#!/usr/bin/perl
$| = 1;
print "Hello World\n";
print "Sleeping 1000 seconds\n";
for (1 .. 1000) {
sleep 1;
print '.';
}