in reply to Regex Basics
Your description and your code are doing two very different things. Of course, that's why it's not doing what you want ;-)
You're looking for all directories that do not have a file "business_use.$node" in them, right? So, why not just do exactly that?
Now @missing_business_use_dirs has your list of nodes.use File::Basename; use File::Spec; # grab the dirs. my @dirs = grep { -d $_ } glob '/app/perform/workspace/htdocs/node_rep +orts/*'; # look for any dirs that do not have the desired file in them. my @missing_business_use_dirs = grep { # find the node name (it's the base name of the current directory) my $node = basename($_); # check if the desired file exists - keep the ones where it doesn't. not -e File::Spec->catfile($_, "business_use.$node"); } @dirs
|
|---|