#!/usr/bin/perl use strict; use warnings; while (<DATA>) { chomp; my ($f, $s) = split; unless (length ($f) == length ($s)) { print "$f-$s\n"; next; } if ($f == $s) { print $f, "\n"; next; } print "$f-", substr ($s => length +(("$f" ^ "$s") =~ /^(\x00*)/) [ +0]), "\n"; } __DATA__ 1 32 4 19 28 39 34 123 321 321 324 329 325 349 340 509
Abigail
In reply to Re: eliding number ranges
by Abigail-II
in thread eliding number ranges
by qq
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |