Help for this page

Select Code to Download


  1. or download this
    ./rename *.pl "s/^/old_/"
    
    ...
    $ARGV[1] == '2.pl';
    $ARGV[2] == '3.pl';
    $ARGV[3] == 's/^/old_/';
    
  2. or download this
    my $pattern = pop @ARGV;
    for my $file (@ARGV){
       my $new = $file;
       # apply pattern and rename
    }