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 $\.
which prints$\ = "\n"; # as perl -l print "before"; { local $\; print "continued"; } print "after"; print "heh!";
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
and not rely on $\ being empty at the time its functions are called.local $\;
Note that printf ignores the settings of $\.
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Re: Re2 (-l): I don't use printf enough
by demerphq (Chancellor) on Oct 23, 2003 at 17:12 UTC | |
by dragonchild (Archbishop) on Oct 25, 2003 at 02:42 UTC |