Elegant can be very subjective...
#!/usr/bin/perl # http://perlmonks.org/?node_id=1208898 use strict; use warnings; use Cwd; cwd =~ m#^(.*)(?:/|$)(??{! -f "$1/.marker"})# or die ".marker not foun +d"; print "found in $1\n";
Update: Small fix for the problem mentioned by AnomalousMonk in Re^3: Recursively walk up a directory tree
cwd =~ m#^(.*)(?=/|$)(??{! -f "$1/.marker"})# or die ".marker not foun +d";
In reply to Re: Recursively walk up a directory tree
by tybalt89
in thread Recursively walk up a directory tree
by 1nickt
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |