in reply to How can I reduce this with a REGEX?
You don't need to use regexes for this. In pseudocode:
use List::MoreUtils qw{uniq} while (<FH>){ chomp; convert each line to an array of numbers splitting by "-" sort the resulting list of numbers and apply uniq to this list: my @list_of_unique_items = uniq @list; join or print again each element followed by a "-" chomp again if needed to delete the last "-" undef the array process the next line
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: How can I reduce this with a REGEX?
by misterperl (Friar) on Mar 14, 2014 at 17:06 UTC | |
by hazylife (Monk) on Mar 15, 2014 at 10:47 UTC | |
by misterperl (Friar) on Mar 17, 2014 at 14:54 UTC |