So use /^[0-9]+$/ which is barely any more typing.
Quite right. There's also an even shorter alternative: /^\d+$/a which uses the handy /a modifier. This has the added benefit of enforcing ASCII restriction on some other classes too, should they be used in the regex.
In reply to Re^3: Moo-Type checking example from Perl Maven: What should be the expected result?
by hippo
in thread Moo-Type checking example from Perl Maven: What should be the expected result?
by Perl300
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |