#!perl -w use strict; my $dir = "E:/Perl/bin/test"; chdir($dir); opendir(DIR, $dir); foreach my $file(readdir(DIR)) { if(!-d $file ) { my $copy = $file; $file =~s/\.HID$//i; $file =~s//\.HID$/i; #ABER WARUM GEHT DAS NUN NICHT??? rename($copy, $file); } } #if(!$file =~/^\./) { rename($file, "$file\.HID"); } closedir(DIR);