[Date Prev][Date Next][Thread Prev][Thread Next] [Search] [Date Index] [Thread Index]

Re: [FWP] Range spec to list/hash



John Porter wrote:
> 
> Prakash wrote:
> >
> > @list = map {m/(\d+)\-(\d+)/ ?  ($1..$2) : $_;} split ",", $range;
> 
> While it's certainly less fun, you might still consider using
> the module Set::IntSpan, from CPAN.

I should have thought about it. Is there anything that CPAN doesn't
have?

> Something more fun:
> 
>         s/-/../g;
>         @list = eval;

I like this.

/prakash

==== Want to unsubscribe from Fun With Perl?  Well, if you insist...
==== Send email to <fwp-request@technofile.org> with message _body_
====   unsubscribe