Beefy Boxes and Bandwidth Generously Provided by pair Networks
Pathologically Eclectic Rubbish Lister

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 $!; }

"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?

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

How do I use this? | Other CB clients
Other Users?
Others examining the Monastery: (7)
As of 2016-02-10 09:05 GMT
Find Nodes?
    Voting Booth?

    How many photographs, souvenirs, artworks, trophies or other decorative objects are displayed in your home?

    Results (340 votes), past polls