in reply to Re: Re: Check user input - reimplementation
in thread Check user input - reimplementation

You mean like this?
Yes.

A ||= D is, in general, the same as A = A ?  A : D without all the repetition. Each assigns to A itself if A is true, and D if it is not true.

The exists check is the same as

$check{'regex'} = $default unless exists($checks{'regex'})
which is to say, it determines whether there a value has been assigned to $checks{'regex'}, and if not, it assigns the default value. Even if the value is false or undefined, exists returns true.

The PerlMonk tr/// Advocate