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

Re^5: rename files

by davorg (Chancellor)
on Aug 08, 2005 at 14:12 UTC ( #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


Comment on Re^5: rename files
Download Code

Log In?
Username:
Password:

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

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

    The oldest computer book still on my shelves (or on my digital media) is ...













    Results (365 votes), past polls