in reply to Re^2: Moo-Type checking example from Perl Maven: What should be the expected result?
in thread Moo-Type checking example from Perl Maven: What should be the expected result?

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.

Replies are listed 'Best First'.
Re^4: Moo-Type checking example from Perl Maven: What should be the expected result?
by tobyink (Canon) on Sep 29, 2018 at 21:46 UTC

    Indeed, but it was only added in 5.14, and I usually like to support older versions of Perl when possible.