Beefy Boxes and Bandwidth Generously Provided by pair Networks
The stupid question is the question not asked
 
PerlMonks  

Re: Renaming all files in a directory

by choroba (Archbishop)
on Feb 02, 2021 at 13:19 UTC ( #11127812=note: print w/replies, xml ) Need Help??


in reply to Renaming all files in a directory

If you don't want to use Perl's glob, use the shell's globbing instead of parsing the output of ls.
perl -we 'rename $_, "image" . $counter++ . ".jpg" for @ARGV' *
map{substr$_->[0],$_->[1]||0,1}[\*||{},3],[[]],[ref qr-1,-,-1],[{}],[sub{}^*ARGV,3]

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others contemplating the Monastery: (3)
As of 2021-04-15 02:20 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found

    Notices?