in reply to Problem with renaming files in directory

Not related to the error-message you get. But why do you use

$new_name =~ s/.*/sniffer1.log/;
instead of
$new_name = "sniffer1.log";
And why do you close DIR inside the foreach-loop?

Rata (scratching his head)