in reply to Re: Finding missing elements in a sequence (code)
in thread Finding missing elements in a sequence (code)
Are all the numbers zero padded to the same length?? Then see my answer below but use the default sort instead of the
numeric sort in both places. The first numeric sort is 'numerifying' the strings and stripping the leading zeroes which messes up the rest of the routine.
Update: Ok, its not necessarily the first sort stripping the zeroes (in my test case, I was doing a numeric sort before I called the sub, so that's what I was seeing), but it does cause the subsequent statements to treat the list as numbers instead of character strings. So you should treat them as either numbers or characters throughout the sub (like using the +0 trick to begin with), but not both.
|
---|
Replies are listed 'Best First'. | |
---|---|
Re: Re: Re: Finding missing elements in a sequence (code)
by clemburg (Curate) on Nov 06, 2001 at 22:13 UTC | |
Re: Runrig and Finding missing elements in a sequence (code)
by demerphq (Chancellor) on Nov 06, 2001 at 22:10 UTC |
In Section
Seekers of Perl Wisdom