foreach my $allfilesfound (@dir_contents) {
my $time = localtime();
print "This file=$allfilesfound took $time to open ";
}
####
my $time = sub { localtime() };
foreach my $allfilesfound (@dir_contents) {
print "This file=$allfilesfound took ".$time->()." to open ";
}