
hacker01
Novice
Mar 4, 2008, 9:27 AM
Post #2 of 2
(1630 views)
|
|
Re: [perlnewb] Mass rename script with alphanumeric sequence
[In reply to]
|
Can't Post
|
|
I am not sure what you are looking for but this bit of code should help you. opendir DIR, "$thedir"; @allfiles = readdir DIR; closedir DIR; foreach $file(@allfiles) { $count++; $newname = "$count"; rename "$thedir/$file", "$thedir/$newname$file"; } } exit;
|