my ($max_file, $max_num); while (defined(my $file = <foo_*.bar>)) { ($max_file, $max_num) = ($1, $2) if $file =~ /^(foo_(\d+)\.bar)$/ and (!defined $max_num or $2 > $max_num); } print "$max_file\n";
In reply to Re: Reading directories and parsing standard names
by runrig
in thread Reading directories and parsing standard names
by Amoe
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |