The weird thing is though, if you substitute chomp() for:
$msg =~ s/\r?\n//sg;
...and then use:
print STDERR "$pkg ($$): $msg";
.....it hangs again.
$msg =~ s/\r?\n//sg;
...and then use:
print STDERR "$pkg ($$): $msg";
.....it hangs again.