I'm new in Perl and appreciate much if someone can help me on this.
foreach $line(@resultans){
my @newresultans = split "_",$line;
## i will have lots more of $newresultans and @ans
push(@ans1, $newresultans[2]);
push(@ans2, $newresultans[3]);
......
......
}
My intention is to split something like this, and push them into many arrays.
12, 2, and so on in the following rows pushed into an array(@ans1). Same goes to 6, 7 (@ans2) and there are much more numbers after that,separated by _. which is to form @ans3, @ans4
2_abc_12_6_.......
2_def_2_7_......
.................
Can I try something like this? but it doesn't seem to work. I really appreciate a lot if someone can help me. Thanks!!
$ANS_name ="ANS_$colnm";
foreach $line(@resultans){
my @newresultans = split "_",$line;
for($colnm=0;$colnm <=$column[0] ; $colnm++){
push(@$ANS_name, $newresultans[2]);
}
}