in reply to eliding number ranges

$ cat index_DATA 1 32 4 19 28 39 34 123 321 321 324 329 325 349 340 509 $ perl -nle's/(\d*)(\d*)\s+\1(\d*)/$1$2-$3/;s/-$//;print' index_DATA 1-32 4-19 28-39 34-123 321 324-9 325-49 340-509 $

perl -e"map print(chr(hex(( q{6f634070617a6d692e7273650a}=~/../g)[hex]))), (q{375542349abb99098106c}=~/./g)"

Replies are listed 'Best First'.
Re: eliding number ranges
by Abigail-II (Bishop) on Nov 13, 2003 at 16:16 UTC
    Same principle as japhy, same mistake:
    $ echo "2 21" | perl -nle 's/(\d*)(\d*)\s+\1(\d*)/$1$2-$3/; s/-$// +; print' 2-1

    Abigail

      aw christ, that still won't work on 2-20. i suck. apologies to everyone. delete my posts if possible.

      perl -e"map print(chr(hex(( q{6f634070617a6d692e7273650a}=~/../g)[hex]))), (q{375542349abb99098106c}=~/./g)"