chdir ($folder); while ($file = <*>){ my ($ext) = $file =~ /(\.[^.]+)$/; #Check file extension if (($ext =~ m/00./) and ($ext ne ".001")){ next; } elsif ($ext eq ".001") { # first file is required my $filenameroot = $file; $filenameroot =~ s/(.+)\.[^.]+$/$1/; # File name root my @list = glob("$folder$filenameroot*"); print "Last element : $list[(scalar @list-1)]\n"; # Last file + of the series } }
In reply to Re^2: Find the last item in a series of files
by fredho
in thread Find the last item in a series of files
by fredho
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |