my $picture = do { my @candidate = sort @pictures; shift @candidate while @candidate and $candidate[0] !~ /$match/; shift @candidate; };