Beefy Boxes and Bandwidth Generously Provided by pair Networks
Keep It Simple, Stupid
 
PerlMonks  

Re^5: rename files

by davorg (Chancellor)
on Aug 08, 2005 at 14:12 UTC ( [id://481892]=note: print w/replies, xml ) Need Help??


in reply to Re^4: rename files
in thread rename files

Then it looks like you're doing things in the wrong order. It should be something like this:

my $dir = '/temp_gif'; opendir (DH, $dir) or die "unable $!"; foreach (readdir DH) { my ($number) = split (/\./); print "$number\n"; $number += 338; rename ("$dir/$_", "$dir/$number.GIF") or die $!; }
--
<http://dave.org.uk>

"The first rule of Perl club is you do not talk about Perl club."
-- Chip Salzenberg

Log In?
Username:
Password:

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

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

    No recent polls found