Maybe the backtick operator ` `? (Backtick on my keyboard is the
tilde key ~ without shift, but it might be different on your
keyboard).
So in place of:
> system 'CTMORDER -SCHEDTAB EM-$ENV-REPORT-LOGS -JOBNAME
> EM-$ENV-$Client_Key-AAL-EMAIL -ODATE ODAT -FORCE Y';
You'd do
my $result = `CTMORDER -SCHEDTAB EM-$ENV-REPORT-LOGS -JOBNAME
EM-$ENV-$Client_Key-AAL-EMAIL -ODATE ODAT -FORCE Y`;
and then look in $result for whatever the other utility would normally
print on the screen.
$? is supposed to be set the same way for system() as for the backtick
operator, but maybe your other Windows program isn't returning a
status properly or something?
On Tue, Jun 23, 2009 at 9:33 PM, Kevin Patterson<kpatters@...> wrote:
>
>
>
>
> Hi,
>
> I am writing a perl program to call/ execute another windows program
>
> Using the system command.
>
> I am trying to get/print the results to see if the command worked.
>
> Is there a way to capture the output of what the program ran??
>
> I tried using system ' ' and system(). I get the same results.. nothing..
>
> Here is my code so far.
>
> #!/usr/bin/perl
>
> # use strict;
>
> # use warnings;
>
> @client = qw(EM AS);
>
> #@client = qw(EM HR KR AS BF DB);
>
> my $eNV = "QW-D";
>
> my $T = '"';
>
> foreach $Client_Key (@client)
>
> {
>
> system 'CTMORDER -SCHEDTAB EM-$ENV-REPORT-LOGS -JOBNAME
> EM-$ENV-$Client_Key-AAL-EMAIL -ODATE ODAT -FORCE Y';
>
> print "Status: $? $!\n";
>
> }
>
> [Non-text portions of this message have been removed]
>
>