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

Re: [FWP] Range spec to list/hash



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.


Something more fun:

	s/-/../g;
	@list = eval;

John Porter


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