in reply to println

I wonder, wouldn't this be more perlish?
#!/usr/bin/perl -w use strict; sub println(@) { print map{"$_\n"} @_; } println 'Foo', 'Bar'; println 'Baz';
Since print accepts an array of things to print, you'd think that the Perl println would provide a shortcut to adding a newline to each element of the array. :)

That said, I've not really missed this shortcut (even though I have a java background), but if it was added, I might just use it.


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

Replies are listed 'Best First'.
Re: Re: println
by tlhf (Scribe) on Jun 07, 2002 at 19:21 UTC
    Well, personally I'm a big fan of print()ing lists, so I'm apprehensive about changing my beloved println. For example, I'm always doing; print($x, $y, $z). Although, now you've stated the idea of printing the list as multiple lines, it's suddenly become very tempting. It's not really println (print-line), but more of a printlns (print-lines)...

    I see this slightly camp module becoming bloated :D