in reply to Re: Passing a value from a module
in thread Passing a value from a module
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 => '' }); } }
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Re: Re: Passing a value from a module
by qq (Hermit) on Apr 15, 2004 at 19:58 UTC |