in reply to find the latest created file in a directory
use the CORE:: prefix:
opendir my $dh, $DIR or die "Error opening $DIR: $!"; my @files = sort { $b->[10] <=> $a->[10] } map {[ $_, CORE::stat "$DIR/$_" ]} grep !m/^\.\.?$/, readdir $dh; closedir $dh; my ($name, @stat) = @{$files[0]};
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: find the latest created file in a directory
by Krambambuli (Curate) on Apr 24, 2013 at 14:59 UTC | |
by Tux (Canon) on Apr 24, 2013 at 15:11 UTC | |
by Krambambuli (Curate) on Apr 24, 2013 at 15:33 UTC |