I want to print the name and age of the odest file entered on the command line:
Code:
my @oldest;
foreach (@ARGV){
if (-A $_ > $oldest[1]){
$oldest[1] = -A $_;
$oldest[0] = "$_".",";
}
print "@oldest ";
}[\code]
I expected only the oldest file (name and age) to print, but instead I get the names ann ages of all files entered on the command line