No thank you. I would prefer that simple functions not make arbitrary decisions under the guise of "smartness". What if I want that extra newline? Using say is perfect for temporarily peppering code for debugging. As such, it's not helpful for it to have variable behavior. With say $foo, I want to be able to tell if $foo has a newline of its own.
Then what about formatting text with blank lines? Does put chomp one or multiple newlines? What about whitespace between or after newlines? Do you really want to worry about behavior of a bunch of potential edge cases for what should be a simple function? When the convenience of say gives way to unnecessary complexity its usefulness diminishes.
In reply to Re: puts vs say
by hangon
in thread puts vs say
by dgaramond2
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |