I am in the process of teaching myself Perl.
A few things have really stumped me - one I have not yet resolved.
I want to run an executable from a perl script and have any printout from the executable show on the console from which I ran the perl script
This a portion of the code where I want to run the executable
Code:
print "\tQuery results:\n================================================\n";
$numselected = 0;
while ( my @row = $sth->fetchrow_array( ) )
{ $chanid = $row[0];
$starttime = $row[1];
my $title = $row[2];
my $cf = $row[3];
my $cl = $row[4];
my $basename = $row[5];
my $subtitle = $row[6];
# print "$row[0] . $row[1] . $row[2] . $row[3] . $row[4] . $row[5]\n";
if ($basename =~ /$filename/ && !$cf )
{
# print "\nbasename=$basename.......filename=$filename\n";
# print "$row[0] . $row[1] . $row[2] . $row[3] . $row[4] . $row[5]\n";
$numselected = $numselected + 1;
if (!$cf)
{
print "\nCALLING MYTHCOMMFLAG\n";
`mythcommflag -c $chanid -s $starttime`;
print "\nMessage from sys:...$!\n";
}
else
{
print "\n PROGRAM LOGIC ERROR\n";
exit 255;
}
}
print "\nTotal rows selected: $numselected\n"
Here is the output of what I have (no evidance that the executable has actually run
Code:
gary@debian:~/Desktop$ ./tc-inprocess --dir /Video/Mythtv_Recorded --filename 2245_20101127200000.mpg --chanid 2245 --starttime 20101127200000
Query results:
================================================
CALLING MYTHCOMMFLAG
Message from sys:...
Total rows selected: 1
gary@debian:~/Desktop$
gary@debian:~/Desktop$