Beefy Boxes and Bandwidth Generously Provided by pair Networks
There's more than one way to do things
 
PerlMonks  

Re: Recursive search and delete

by NetWallah (Canon)
on Nov 16, 2012 at 06:53 UTC ( #1004139=note: print w/replies, xml ) Need Help??


in reply to Recursive search and delete

Please use <code> tags to preserve format for your code </code>.

Your statement:

if ( $currentFile eq $searchfile )
Looks for an exact string match between the $currentFile and "abc*.xml*".

It is unlikely to find a file with that name.
You could use regular expressions to match the file name, but I would recommend re-designing your code around the File::Find module and friends (File::Find::Match).

             "By three methods we may learn wisdom: First, by reflection, which is noblest; Second, by imitation, which is easiest; and third by experience, which is the bitterest."           -Confucius

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://1004139]
help
Chatterbox?
[Discipulus]: why perl -e 'print q(\'a string\'),"\n"' gives -bash: syntax error near unexpected token `)' ??
[Discipulus]: i'm not escaping correctly?
[moritz]: Discipulus] iirc bash doesn't let you escape ' with \
[moritz]: not inside a single-qouted string at least
[moritz]: echo 'a'\''

How do I use this? | Other CB clients
Other Users?
Others surveying the Monastery: (9)
As of 2017-11-24 10:13 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    In order to be able to say "I know Perl", you must have:













    Results (346 votes). Check out past polls.

    Notices?