Beefy Boxes and Bandwidth Generously Provided by pair Networks
more useful options
 
PerlMonks  

Re: remove files starting with white from its folders and sub folders using perl?

by 1nickt (Canon)
on Apr 17, 2017 at 11:09 UTC ( [id://1188121]=note: print w/replies, xml ) Need Help??


in reply to remove files starting with white from its folders and sub folders using perl?

if ($d1 =~ /^white*/)

This matches any string consisting of 'whit' at the beginning followed by zero or more 'e' characters. Probably not what you wanted.

perl -Mstrict -WE ' say "`$_` " . ( $_ =~ /^white*/ ? "match" : "no match" ) for ("while", "whine", "white", "whitf", "whit ", "whit!", "whit") +; '
`while` no match `whine` no match `white` match `whitf` match `whit ` match `whit!` match `whit` match

Hope this helps!


The way forward always starts with a minimal test.

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://1188121]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others lurking in the Monastery: (5)
As of 2024-04-25 19:59 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found