Help for this page

Select Code to Download


  1. or download this
    print get_num('.');
    
    ...
        (sort{$b<=>$a}
        map{/(\d+)/, $1}<$dir/foo_*.bar>)[0] + 1;
    }
    
  2. or download this
    sub get_num{
        my $dir = shift;
    ...
        /(\d+)/ and $1>$c and $c=$1 while <$dir/foo_*.bar>;
        return $c+1;
    }