#! c:\perl\bin
$|++;
use strict;
use vars qw /%data/;
$data{apps_list} = shift @ARGV;
system (cls);
print "\n\nPath to apps list => ". $data{apps_list}."\n";
open (LST, "$data{apps_list}") || die "$! : File was not found\n";
chomp (@{$data{Go_scripts}} = <LST>);
for my $item (@{$data{Go_scripts}})
{
print "\n$item\n";
system ($item);
if (system() ==0) # this is incorrect
{
print "\n Done\n";
}
else
{
print "Failed\n";
}
}
Obviously it doesn't work because of the "if (system() ==0)" which is not correct, but the correct way of this is what I am trying to achieve!
Any Thoughts?
TIA
|