Help for this page

Select Code to Download


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