1 # Copyright 2010 Interchange Development Group and others
3 # This program is free software; you can redistribute it and/or modify
4 # it under the terms of the GNU General Public License as published by
5 # the Free Software Foundation; either version 2 of the License, or
6 # (at your option) any later version. See the LICENSE file for details.
8 CodeDef numeric_strict OrderCheck
9 CodeDef numeric_strict Description Numeric (strict)
10 CodeDef numeric_strict Routine <<EOR
12 my ($ref, $name, $value, $msg) = @_;
14 if (defined($value) and $value =~ /\A-?\d+(?:\.\d+)?\z/) {
15 return (1, $name, '');
18 return (0, $name, defined($msg) ? $msg : 'not strict numeric');