in reply to How do I un-map this code?
sub _file_containing { my($self, $id) = @_; opendir(my $dir, $self->{update_dir}) or return; my @files = sort { $a <=> $b } grep { /^\d+$/ && $_ <= $id } readd +ir $dir; return undef if !@files; return "$self->{update_dir}/$files[-1]"; }
... I don't know that it's particularly more legible, though.
Oh -- and the '_' prefix tends to be used in OO code to mark private methods.
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
| A reply falls below the community's threshold of quality. You may see it by logging in. |