Syntactic Confectionery Delight | |
PerlMonks |
Re: Union of overlapping numeric intervalsby atcroft (Abbot) |
on Dec 30, 2013 at 22:50 UTC ( [id://1068782]=note: print w/replies, xml ) | Need Help?? |
Here is a one-liner that provides an example of parsing of lists similar to those you provide into individual letter:number ranges:
Here is a one-liner that provides an example of parsing a key and value or range to get the key, starting and ending values (or repeats the starting value as the ending value, if there is only one value present:
Here is a one-liner that provides an example of filling in a hash with values in a range (the Data::Dumper code present only to verify that the values were set:
Here is a one-liner that takes a hash with values and loops through, to determine the consecutive ranges present:
With all of the examples above, there should be enough, with the addition of a small amount of code, to do what you desire. If not, then you might want to refocus your study of perl on the areas you still find yourself weakest in. Please comment in the thread if you have any questions. Hope that helps.
In Section
Seekers of Perl Wisdom
|
|