http://www.perlmonks.org?node_id=301581


in reply to Re2 (-l): I don't use printf enough
in thread I don't use printf enough

I like -l but wish that there was a way to selectively counter-act it, as I occasionally (but not often) want to print a newline-less line. How do you handle these situations?
Localize $\.
$\ = "\n"; # as perl -l print "before"; { local $\; print "continued"; } print "after"; print "heh!";
which prints
before
continuedafter
heh!
In fact, you can set $\ to anything, and with local, it's safe — or at least, as safe as using $\.

IMO, every module that uses print in a hidden fashion, should use

local $\;
and not rely on $\ being empty at the time its functions are called.

Note that printf ignores the settings of $\.