How can Perl's print add a newline by default?

Posted by Mike on Stack Overflow See other posts from Stack Overflow or by Mike
Published on 2010-05-24T18:40:39Z Indexed on 2010/05/25 5:01 UTC
Read the original article Hit count: 194

Filed under:
|
|

In Perl most of my print statements take the form

print "hello." . "\n";

Is there a nice way to avoid keeping all the pesky "\n"s lying around?

I know I could make a new function such as myprint that automatically appends \n, but it would be nice if I could override the existing print.

© Stack Overflow or respective owner

Related posts about perl

Related posts about print