Beefy Boxes and Bandwidth Generously Provided by pair Networks
XP is just a number
 
PerlMonks  

Re: Renaming Files

by Shendal (Hermit)
on Feb 19, 2003 at 19:49 UTC ( #236786=note: print w/ replies, xml ) Need Help??


in reply to Renaming Files

I strongly recommend File::Find. Here's an example of what it might look like:

use File::Find; my $dir = shift || '.'; find \&wanted, $dir; sub wanted { next unless (-f && /\.cfm$/); my $newname = $File::Find::name; $newname =~ s/\.cfm$/.html/; rename $File::Find::name,$newname or die "Unable to rename $File::F +ind::name!"; }

Cheers,
Shendal


Comment on Re: Renaming Files
Download Code

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others taking refuge in the Monastery: (5)
As of 2014-08-23 10:22 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    The best computer themed movie is:











    Results (173 votes), past polls