37,743
社区成员




use strict;
my $My_PATH="E:\\test";
my @resulttxts = <$My_PATH."/".result.txt.*>;
my $result_index=1;
for my $conf_file (@resulttxts){
if($conf_file=~/result.txt.(\d)$/ || $conf_file=~/result.txt.(\d\d)$/)
{
#print $1."\n";
if($1 >= $result_index){
$result_index=$1;
}
}
}
my $result_out ="result.txt."."$result_index";
print "file: $result_out\n";
#/usr/bin/perl
use strict;
use warnings;
my $My_PATH="E:\\test\\";
opendir DIR, $My_PATH or die $!;
my @file = grep {/result.txt.\d{1,}/} readdir DIR;
my @sort_file = map {$_->[3]}
sort {$b->[2] <=> $a->[2]}
map {[split (/\./), $_]} @file;
my $maxNO_file = $sort_file[0];
print $maxNO_file,"\n";
my @resulttxts = <$My_PATH."\\".trail.txt.*>;