#!/usr/bin/perl use 5.010; use strict; use warnings; open GL,'gene_list.txt'; open HFR,'HFR_genes.txt'; use List::MoreUtils qw(first_index indexes); my @gl=<GL>; my @hfr=<HFR>; chomp @gl; chomp @hfr; my $a; for($a=0;$a<=scalar(@hfr);$a++) { my @matching_indices=indexes {$hfr[$a]}@gl; my @matching_values=@gl[@matching_indices]; print "$matching_indices[$a]"; }
In reply to use of uninitialized value in array by rocketperl
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |