in reply to Re^9: Hash Question
in thread Hash Question

Hello Anonmous monk, I'm making progress:
foreach (<$ah>) { my @text = split(/\t/); for my $value (@text[11, 14, 17]) { if ($bHash{ $text[3] } eq $value) { $bHash{ $text[0] } = $value; last; } print OUT2 join( "\t", @text[1,2,3,4,11,5,6,8,7,11,12]),"\t1\t1\n" +; } } close $ah;
it works however the results seem to be duplicated? Thank you

Replies are listed 'Best First'.
Re^11: Hash Question
by perlnoobster (Sexton) on Jan 09, 2013 at 14:10 UTC
    That's strange, even if I use just the original column i.e. 11 the results are generated but not correctly:
    foreach (<$ah>) { my @text = split(/\t/); for my $value (@text[11]) { if ($bHash{ $text[3] } eq $value) { $bHash{ $text[0] } = $value; last; } print OUT2 join( "\t", @text[1,2,3,4,11,5,6,8,7,11,12]),"\t1\t1\n" +; } } close $ah;