my code is as follow
the result print out
A K Y T C D E F values for $chains now i want top store all these in an array @chains i do not know how to do
i tried using split but it only give the one last enty F
also if i print $chains out side while loop it give only F
how i can take all the values for $chains out of while loop.
regards
Code:
open (SP, "myfile");
my $chains;
my @chains;
while(<SP>){
if ($_=~/^COMPND\s+\d+\sCHAIN:\s(.)/){
$chains=$1;
print "$chains";
}
}
the result print out
A K Y T C D E F values for $chains now i want top store all these in an array @chains i do not know how to do
i tried using split but it only give the one last enty F
also if i print $chains out side while loop it give only F
how i can take all the values for $chains out of while loop.
regards