in reply to unnecessary warning message?

Using lexical filehandles will avoid those warnings.

#!/usr/bin/perl -w sub handle_error { if (open my $log, ">/dev/null") { carpout($log); } } print "hello world.\n";