in reply to Re: puts vs say
in thread puts vs say

It was ported from perl6, so it does what perl6 say does.

Replies are listed 'Best First'.
Re^3: puts vs say
by jettero (Monsignor) on Feb 28, 2009 at 12:37 UTC
    I get it. I didn't say it does chomp, I said it should chomp.

    -Paul

      certainly other people would complain if say() chomps automatically!

      so what's wrong with defining your own puts() beside of say()

      DB<13> sub puts {my $x=pop; chomp($x); print @_,$x,"\n"} DB<14> puts 1,2,3,"a\n" 123a DB<15>
      Btw.
      • Does puts() take a list in ruby?
      • Are all elements chomped or just the last one?
      with your own solution you have full control about the behavior...

      Cheers Rolf

        For that matter, I could write my own output routines every time -- which I often do, and which usually corrects newline-ed-ness automagically. I just think the way say is defined presently is pretty pointless. Why even bother with it. I'd also like to point out that I'm not the OPer. This isn't my argument, I'm just agreeing with the OP.

        -Paul