Just another Perl shrine | |
PerlMonks |
filtering an arrayby prbndr (Acolyte) |
on Sep 01, 2012 at 19:08 UTC ( [id://991184]=perlquestion: print w/replies, xml ) | Need Help?? |
prbndr has asked for the wisdom of the Perl Monks concerning the following question: hi monks, another rookie perl question... i have an array that i populate with the following code: push @positions, $read->end + 1, $base;the first entry ($read->end + 1) is a number and the second entry is a string that can be an A,G,C, or T, so each line of this array is a number/string pair. i would like to remove every line of this array that contains a G or a T as the string. after doing that, i would like to get rid of the strings altogether, so i just have an array with one column representing the number. how do i go about this? i've looked into the pop function, which seems relevant for the second half of what i want to do, but i am unsure about how to do the filtering, namely accessing the second element in each line of the array. any advice would be much appreciated!
Back to
Seekers of Perl Wisdom
|
|