Beefy Boxes and Bandwidth Generously Provided by pair Networks
Problems? Is your data what you think it is?
 
PerlMonks  

Re: rename files in directory with new extenstion

by George_Sherston (Vicar)
on Aug 09, 2001 at 23:09 UTC ( [id://103572]=note: print w/replies, xml ) Need Help??


in reply to rename files in directory with new extenstion

This does it in one line. Also I wonder if, in BIG applications, you might get a time saving by avoiding regexp? This is not a rhetorical question - I'd be interested to know.

while($f=<*.old>){rename $f, substr($f,0,-3).'new'}


§ George Sherston

Replies are listed 'Best First'.
Re: Re: rename files in directory with new extenstion
by mischief (Hermit) on Aug 09, 2001 at 23:12 UTC

    This would not work for file with extensions longer than 3 characters (eg any .html file). Not that I really need to point that out...

    note: happy 100th node, me

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others scrutinizing the Monastery: (8)
As of 2024-04-18 10:03 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found