in reply to rename files

The problem is the foreach passes to block just the filename (1.gif, 3.gif). You should concatenate the path (/temp_gif) and the filename (3.gif) when rename()ing.
$dir = "/temp_gif"; opendir(DH, $dir) or die $!; foreach (readdir DH) { next if /^\.?\.$/; ($number, $gif) = split /\./; print "$number\n"; $numbers_replace = int($number) + 338; rename("$dir/$_", "$dir/$numbers_replace.GIF") or warn $!; }


Igor S. Lopes - izut
surrender to perl. your code, your rules.