#!/usr/bin/perl

#設定ファイルの読み込み
$EXT = "gif";
$n = 0;

opendir(DIR, ".");
@FILES = grep(/$EXT$/, readdir(DIR));


foreach $FILE (@FILES){

    $IMAGE_NUM = $FILE + $n;
    $IMAGE_NUM =~ s/\.$EXT//;
    $IMAGE = sprintf("%03d", $IMAGE_NUM);

    print "$mv $FILE...$IMAGE.$EXT \n" ;
    system ("mv $FILE $IMAGE.$EXT") ;
}




