http://qs321.pair.com?node_id=11118363


in reply to Re^4: Efficient way to verify scalar contents
in thread Efficient way to verify scalar contents

Note that both of your solutions don't report an error for e.g. 'aaaaaaaaa0-' and 'aaaaaaaaaaaaaaaaaaa', which are invalid as per the OP's code.

Replies are listed 'Best First'.
Re^6: Efficient way to verify scalar contents
by LanX (Saint) on Jun 22, 2020 at 13:22 UTC
    you are right, I had a bug in the uppercase rule!

    my $uppercase =  sub { /[a-z]/ ? "" : "has no uppercase character" };

    should be

    my $uppercase =  sub { /[A-Z]/ ? "" : "has no uppercase character" };

    C&P is your enemy! =)

    Cheers Rolf
    (addicted to the Perl Programming Language :)
    Wikisyntax for the Monastery