Jerry Preston wrote:
Hi!

Hello,

I am looking for a simple Perl way to decode the following, which can be any
grouping of number


   2-8,9,11,18-21

Into
   2,3,4,5,6,7,8,9,11,18,19,20,21

$ perl -le' print join ",", map /(\d+)-(\d+)/ ? $1 .. $2 : $_, split /,/, "2-8,9,11,18-21"'
2,3,4,5,6,7,8,9,11,18,19,20,21




John
--
use Perl;
program
fulfillment

--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
<http://learn.perl.org/> <http://learn.perl.org/first-response>




Reply via email to