use strict; use warnings; my $topdir = '/home/ansh/perlmonks'; opendir(HU, "$topdir"); my @files = grep(/\.txt$|.TXT$/,readdir(HU)); closedir(HU); #print "@files"; #my $ucount = 0; foreach my $file(@files) { #my $frame = $files[$ucount]; if($file =~ /^p(1|2|3)/) { print "$file\n"; # my $frameu = my $frame; } else { #print "$frame"; } # $ucount++; }
p1.txt p3.txt p2.txt
In reply to Re: name of the last file
by ansh batra
in thread name of the last file
by basheer
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |