in reply to Clever timestamp comparison

You could just change the 'map' to 'grep' in your non-functional example. But that seems wasteful. Don't go through more files than you need.
my $file = $0; { return if (stat $_)[9] > $ft; do { $file = glob "$dir/*" } until -f $file; redo if defined $file; }
Try something like that. I don't think using a do ... until ..., nor a do ... redo is ugly. They exist for specific reasons. However, here's another approach:
for (my $file = $0; defined $file; $file = glob "$dir/*") { next unless -f $file; return if (stat $_)[9] > $ft; }
modified: or
for (my $file = $0; ; $file = glob "$dir/*") { last unless defined $file; next unless -f $file; return if (stat $_)[9] > $ft; }


japhy -- Perl and Regex Hacker