in reply to numbers with leading zeros

Oh goodie, an opportunity to plug my Number::Phone module! Although it doesn't have phone number comparison methods right now. Should I add them?

Anyway, you can make perl compare your numbers correctly by making sure that you always treat them as strings. As you can see here, using string comparison operators Does The Right Thing with strings:

$ perl -e 'print "01234" eq "01234"' 1 $ perl -e 'print "01234" eq "1234"'

But using a numeric comparison Does The Wrong Thing:

$ perl -e 'print "01234" == "1234"' 1
The moment that you use any non-string operator on a variable, you can assume it will Do The Wrong Thing.