in reply to Re: println
in thread println

Getting feisty, aren't we?

While I don't much see the use for an internal function named println, which reminds me of Pascal of all things, how about doing it correctly?
sub println { print ((@_? join($/, @_) : $_), $/); }
Not everyone uses UNIX, BeOS, or AmigaOS, so putting a literal "\n" in there is simply bad form.

Update:
As Dog and Pony points out, "\n" does represent a logical newline, as it is quietly and magically transformed into the appropriate value before being output. One could argue, though, that using $/ eliminates four shifted keystrokes.

Replies are listed 'Best First'.
Re(3): println
by Dog and Pony (Priest) on Jun 07, 2002 at 20:18 UTC
    According to perlport, \n represents a logical newline, and thus (often) actually does the right thing across platforms.

    That said, nothing wrong with erring on the side of safety. :)


    You have moved into a dark place.
    It is pitch black. You are likely to be eaten by a grue.