http://qs1969.pair.com?node_id=1022016


in reply to TK Entry - Validating Input

Your regex m/^[0-9a-fA-F]+/ doesn't match the empty string, so when you try to remove the last character your validation fails and the remove is disallowed.

Try return 0 unless( $_[0] =~ m/^[0-9a-fA-F]*/ ) instead.