I dont think you need a module to make that, any way 01 or 1 is still a number and zero is a neutral number.
#!/usr/bin/perl -w
$_="Testing numbers 12";
print "Numbers: <$1>" if ( /(\d*)/ );
I think this might work
| [reply] [d/l] |
But it doesn't work, that's exactly the reason why you should use a module!
Zaxo has a 'working' hand-rolled solution somewhere else in this thread, though it breaks on negative numbers (which might or might not be OK, depending on the input data). Granted, in this simple case it might be OK not to use a module but still you have to know what you are doing. In all but the most trivial cases, use the module and spare yourself the extra debugging work. Try e.g. to match a general floating point number like -2.4345e-12 and then you know why it's better/easier/quicker to use a module.
-- Hofmator
| [reply] |