my %opt = @_; #### ( -d "$opt{ dir }/$_" ) # is a directory #### && !/^\./ # is also not hidden/special #### && /(\d{4}_\d{2}_\d{2}_\d{2})/ # contains date/hour #### && ($opt{ now } gt $1 ) # that is in the past