hi all,
I've got a list of filenames like this:
IT1.txt
IT2.txt
IT3.txt
[...]
IT10.txt
IT11.txt
IT12.txt
[...]
DE1.txt
DE2.txt
DE3.txt
[...]
DE10.txt
DE11.txt
DE12.txt
and I need to extract the biggest number in these files (12 in the
example, the files are always in pairs)
Actually I use a while loop to extract the numbers:
while (defined($file = readdir(DIR)))
{
next if $file =~ /^\.\.?/;
$file =~ s/[A-Z]+(\d+).txt$/$1/;
# ????
}
but I ignore how to select the last number.
Someone can suggest to me a way to work?
Thank at all!
alladr
|^|_|^|_|^| |^|_|^|_|^|
| | | |
| | | |
| |*\_/*\_/*\_/*\_/*\_/* | |
| |
| |
| |
| http://www.e-allora.net |
| |
| |
**************************************
--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
<http://learn.perl.org/> <http://learn.perl.org/first-response>