# 1C. more "correct", with additional variable and concept for my $entry (glob "*") { next unless -d $entry; my $dir = $entry; ... }