I'm trying to read in a data file into an array. And split it into lines. I've a for loop which will parse the array, split the line (on ",") and execute another command. Here is the code.
Problem is that PERL will parse only the last 11 lines from the data file.
Problem is that PERL will parse only the last 11 lines from the data file.
Code:
open TestList, "Testlist.dat" or die "Cannot open file to read data\n";
@array = <TestList>;
close TestList;
print (@array); <<< This prints the complete data file - all 22 line >>>
$test = pop (@array);
foreach $array (@array ) {
@tests = split(/,/,$test);
print @test; <<< This prints the last 11 lines only >>
$telnet->print("cd /root/kal/ameritec/");
$telnet->print("mkdir $tests[0]");
$telnet->print("cd $tests[0]");
$TNdir = $tests[0];
$TN1 = $tests[1];
$TN2 = $tests[2];
print ("$TNdir is being run - $TN1, $TN2");
# $telnet->print("nohup ../analyzeTrace.sh /root/kal/AM/$TNdir $TN1
$TN2 &");
# sleep (300);
$test = pop (@array);
$n++;
}
Comment