?use Cwd; my $docroot = '/www/stage/sites/MyCompany/docs'; my $cfgdir = $docroot; my $dir = getcwd; $dir =~ s{^$docroot/}{}; my (@dirs) = split '/', $dir; while (not -e "$cfgdir/filename.cfg" and @dirs) { $cfgdir .= '/' . shift(@dirs); }
In reply to Re: Checking subdirectories in a given path
by Roy Johnson
in thread Checking subdirectories in a given path
by aarestad
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |