- or download this
sub validate_int {
my $str = shift;
...
|| sprintf("%0*s", length $max, $str) gt $max;
return 0+$str;
}
- or download this
use warnings;
use strict;
...
ok exception { validate_int("999999999999999999999999999999999999") };
done_testing;
- or download this
#!/usr/bin/env perl
use warnings;
...
first 4544/s -- -70% -90%
second 15386/s 239% -- -67%
third 46631/s 926% 203% --