Anonymous Monk has asked for the wisdom of the Perl Monks concerning the following question:
I would like to get the first word from each row of my @AoA[][] and push it into the array @kmers. Can anybody help me get there? This is what I've done so far. Thanks in advance everybody!
my(@kmers); my($x) = 0; my($y) = 0; for ($x=0, $x<7, $x++){ for ($y=0, $y<$AoA[$x], $y++){ my($firstword) = ''; $firstword = $AoA[$x][$y] =~ /^(\w+)/; push @kmers, $firstword; print $firstword."\n"; } }
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: First word
by hippo (Archbishop) on Oct 21, 2016 at 11:17 UTC | |
by afoken (Chancellor) on Oct 22, 2016 at 07:04 UTC | |
by Marshall (Canon) on Oct 22, 2016 at 12:47 UTC | |
by Anonymous Monk on Oct 21, 2016 at 12:02 UTC | |
by GotToBTru (Prior) on Oct 21, 2016 at 12:39 UTC | |
by hippo (Archbishop) on Oct 21, 2016 at 12:40 UTC | |
by Marshall (Canon) on Oct 22, 2016 at 00:56 UTC | |
by hippo (Archbishop) on Oct 22, 2016 at 08:58 UTC | |
|
Re: First word
by Laurent_R (Canon) on Oct 21, 2016 at 11:13 UTC |