Guest User

Untitled

a guest
Mar 19th, 2018
106
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.50 KB | None | 0 0
  1. use strict;
  2. ``use warnings;
  3. ``my (%hash,
  4. );
  5. while(my $line=<DATA>) {
  6. chomp $line;
  7. my ($letter, $object, $number)=split /,/, $line;
  8. $number+=0; # in case there is a whitespace at the end
  9. push @{$hash{$object}{$number}}, [$letter,$number,$line];
  10. }
  11.  
  12. for my $object(sort keys %hash) {
  13. my $oref = $hash{$object};
  14. if (1==keys %$oref) {
  15. next;
  16. }
  17. my $str;
  18. for my $item (values %$oref) {
  19. $str .= $str ? " $item->[0][2]" : "$item->[0][2] is not matching with";
  20. }
  21. print ($str,"n");
  22. }
Add Comment
Please, Sign In to add comment