I'm not sure what you trying to match, you say the user can enter either the literal string "/" or the regular expression /\/w+/ but then test for neither.
m|\x2f{1}?| is just an obscure way of sayingm|/| which is not the same thing as $fs eq "/". The g modifier seems unnecessary. The next test checks for input that doesn't match /\/w+/.
I will guess that you don't want to prune if the directory path has a '/' and do otherwise.
find_me( $fs, $fs =~ m|/| ); sub find_me { my @directory = shift; # play nicely with others local $File::Find::prune = shift; <snip> }
In reply to Re: file::find question
by hipowls
in thread file::find question
by mikejones
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |