in reply to Re^4: Using grep to pick out Specific lines in a text file
in thread Using grep to pick out Specific lines in a text file

Guess what! That's what $found{$1}++ is for. Just print not only the keys but also the values of hash %found.

Replies are listed 'Best First'.
Re^6: Using grep to pick out Specific lines in a text file
by itguy87 (Novice) on Apr 17, 2013 at 20:08 UTC

    That is what i thought but i was working with it and cuold not make it produce what i wanted

      Instead of

      print join( "|", keys %found), "\n";

      try

      for my $key (keys %found) ( print "$key: $found{$key}\n"; }

        added that and it comes back blank