sub _print { my ($msg) = @_; print $msg, "\n"; print LOG $msg, "\n"; } _print("hello"); _print("world");