SPUG: 0 == undef

David Dyck david.dyck at fluke.com
Wed Apr 7 14:45:42 CDT 2004

On Wed, 7 Apr 2004 at 12:27 -0700, Tim Maher <tim at consultix-inc.com> wrote:

> Maybe the latest Regexp::Common (which I don't have handy)
> has a regex to match numbers, otherwise, it's pretty easy
> to roll your own (but don't forget leading - signs, and
> embedded decimal places).

The online perl FAQ give advice on testing for numbers, try:
 perldoc -q determine number
which will provide advice for testing for number

Yes Regexp::Common has a lot of support for matching numbers
   perldoc Regexp::Common::number
which provides regexes for numbers (integers and reals).
You are warned
       Do not use this module directly, but load it via

It even parses Roman numerals!

More information about the spug-list mailing list