in reply to Re: Example of complex constraint with HTML::FormValidator
in thread Example of complex constraint with HTML::FormValidator

An anonymous subroutine means a reference to a subroutine. That reference may be constructed from a real one, or from one created on the fly.

There is little one can do with normal subroutines that cannot be done by storing anonymous subroutines in variables and calling them indirectly. (Exceptions include special subroutines like AUTOLOAD, DESTROY, and import.) The converse is not true.

Therefore while you may find constructing anonymous subroutines from normal ones to be more comfortable to think through, I doubt that they are actually more flexible.

  • Comment on Re (tilly) 2: Example of complex constraint with HTML::FormValidator