Beefy Boxes and Bandwidth Generously Provided by pair Networks
"be consistent"

Re^9: Hash Question

by Anonymous Monk
on Jan 09, 2013 at 13:05 UTC ( #1012475=note: print w/replies, xml ) Need Help??

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

hey choroba, I've tried adding curly brackets but i still cannot figure out what the issue is, please help? Thank you

Have you read perlintro?

for ( ... ) { # start something

    for ( ... ) { ... }

} # end something

Replies are listed 'Best First'.
Re^10: Hash Question
by perlnoobster (Sexton) on Jan 09, 2013 at 13:33 UTC
    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
      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;

Log In?

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://1012475]
and all is quiet...

How do I use this? | Other CB clients
Other Users?
Others having an uproarious good time at the Monastery: (4)
As of 2018-03-24 21:56 GMT
Find Nodes?
    Voting Booth?
    When I think of a mole I think of:

    Results (299 votes). Check out past polls.