All pastes #35374 Raw Edit

Something

public text v1 · immutable
#35374 ·published 2005-12-31 12:02 UTC
rendered paste body
#!/usr/bin/perl

my %listing;

open(LS, "ls ???_????.???|");

        foreach $file (<LS>) {

                chomp($file);
                $file =~ /img_(\d{4})\.jpg/;
                my $new_num = ($1 + 1300);
                
                $listing{$file} = "2005_" . $new_num . ".jpg";

        }

        while (($old, $new) = each(%listing)) {
                        print "$old => $new";
                        print "\n";
                        system("echo mv ./$old ./$new");
        }


close(LS);