- or download this
$dir="/home/yehuda/img/jpg/";
chop $dir;
- or download this
while (defined ($img=readdir DH)){
$img=~m/^(.*)\.(.*)\.(.*)/g;
$newname="$1.$3";
- or download this
push @names,$img;
push @newnames,$newname;
}
- or download this
close DH;
- or download this
foreach $name(@names){
$i=$i+1 ;
$newname_=$newnames[$i-1];
- or download this
$path="$dir/$name";
$target="$dir/$newname_";
- or download this
chomp($target,$path);
- or download this
rename ($path,$target) or die "Could not rename:$!";
print " $path is now $target \n";
- or download this
$dir="/home/yehuda/img/jpg";
...
}
}
closedir DH;