EXAMPLE

Inside of this Distribution is a directory named example. Run this *.pl files.

DESCRIPTION

This module was written because the smartmatch operator ~~ was deprecated as experimental.

That module implements some "in" subroutines with smartmatch similar behaviour.

First I tried to delete the obsolete looking numeric_in. In tests I realized that objects with overloaded + working there but string_in expects objects with overloaded "". So there are some special cases for numeric_in. Because of such minimal cases numeric_in is not exported as default.

SUBROUTINES/METHODS

subroutine string_in

"any1" or "any2" can contain 0 or more values. The first string match of "any1" and "any2" will return true. Also the frist match of undef in "any1" and "any2" will return true. All other will return false. In case of a hash or hash reference the keys are used.

subroutine numeric_in

A given value will be used as numeric if it is defined. Maybe that thows a numeric warning if a string looks not like numeric. The difference to subroutine string_in is, that here is operator == used instead of operator eq.