use File::Spec; use strict; my $dir = '/foo/bar'; my $filesdir = File::Spec->catdir($dir, 'files'); my $file = ''; opendir my $dh, $filesdir or die "Can't opendir, $filesdir: $!"; while (readdir $dh) { if (/\.txt$/) { $file = $_; last; } } print $file . "\n";
In reply to Re: Removing glob
by wind
in thread Removing glob
by perl_mystery
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |