sub numbers { my ($class, $value, $len) = @_; if (!$value) { return (undef, { msg => 'cannot be blank.' }); } elsif (length($value) > $len ) { return (undef, { msg => 'has too many characters.' }); } elsif ($value !~ /^([0-9 \.-]*)$/) { return (undef, { msg => 'can only use numbers.' }); } else { return ("$1", { msg => '' }); } }
In reply to Re: Re: Passing a value from a module
by bradcathey
in thread Passing a value from a module
by bradcathey
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |