Help for this page
print q[@directories has $path] if grep $_ eq $path, @directories;
foreach (grep $_ eq $path, @directories) { # your code here }