!/usr/bin/perl use strict; use warnings; sub get_sorted_files { my $path = shift; opendir my($dir), $path or die "no puedo abrir $path: $!"; my %hash = map {$_ => (stat($_))[9] || undef} # saltar listas vacias map { "$path$_" } grep { m/.dbf/i } readdir $dir; closedir $dir; return %hash; } my %files = get_sorted_files("/oracle/arclog/DBID/"); print " "; foreach my $key (sort{$files{$a} <=> $files{$b}} keys %files) { my $filename = $key; $filename =~ s/\.\///g; $filename =~ s/\.\.//g; print "\n"; } print "
ArchivoTimestamp
$filename", scalar localtime($files{$key}), "
";