|
|
|
good chemistry is complicated, and a little bit messy -LW |
|
| PerlMonks |
Re: get next higher numberby Limbic~Region (Chancellor) |
| on Jun 11, 2018 at 16:48 UTC ( [id://1216408]=note: print w/replies, xml ) | Need Help?? |
|
ovedpo15,
What you are trying to do is find an item in a list and then return the item that comes after it. That's relatively simple but you should be able to deal with things like unordered lists, duplicate items, etc. if those things matter. If you know you will always have an ordered list with unique entries - you could turn this into a binary search: The code above is untested. I haven't coded for several years now but I think it is close. Cheers - L~R
In Section
Seekers of Perl Wisdom
|
|
||||||||||||||||||||||||||||||