Why go to the trouble of using a hash?
#!/usr/bin/perl # http://perlmonks.org/?node_id=1146923 use strict; use warnings; $_ = join "\t", qw(1 A 1 B 2 G 2 H 2 V); 1 while s/\b((\d+)\s\S+)(.*?)\s\2\s(\S+)/$1:$4$3/; print "$_\n";
In reply to Re: print identical keys once along with their values
by Anonymous Monk
in thread print identical keys once along with their values
by bsherkhane
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |