![]() |
|
Problems? Is your data what you think it is? | |
PerlMonks |
Re: Re: Re: Re: Finding missing elements in a sequence (code)by clemburg (Curate) |
on Nov 06, 2001 at 22:07 UTC ( #123644=note: print w/replies, xml ) | Need Help?? |
Adding 0 to the string "00001" forces the string to be interpreted as a number. In your code, when you say:
You force "00001" to be treated as a number, too. What *is* interesting is *why* "00001" is treated as a number, since there is also the possibility of doing "aaa" ... "zzz" and having it work, too. So why does "00001" end up being treated as "1" by the ".." operator? Probably the perl interpreter looks at your $low and $high and decides they look like numbers. BTW, you should not do this $low .. $high stuff - it can hang you badly if $low and $high end up to be interpreted as strings. At least use int($low) .. int($high), to force $low and $high to be interpreted as numbers.
Christian Lemburg
In Section
Seekers of Perl Wisdom
|
|