http://qs1969.pair.com?node_id=11127812


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]