in reply to print identical keys once along with their values
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";
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: print identical keys once along with their values
by bsherkhane (Initiate) on Jan 26, 2016 at 06:38 UTC | |
by Athanasius (Archbishop) on Jan 26, 2016 at 07:40 UTC |