|Perl: the Markov chain saw|
For the 'print' function in perl v5.14by Diamondust (Novice)
|on Sep 24, 2012 at 17:11 UTC||Need Help??|
Diamondust has asked for the
wisdom of the Perl Monks concerning the following question:
Solved. It is a wrong .bashrc file that gives an alias adding the -l switch...
In perl v5.10, as pre-installed on my Ubuntu 64bit 10.04 LTS OS, the 'print' function does not append "\n" after it automatically (which is the right behavior). So the following command:$ /usr/bin/perl -e 'print 123; print 456' # v5.10
will print:123456 # no NL appended
But in perl v5.14 in my own folder, 'print' behaves exactly the same as 'say', i.e. it prints a "\n" after it every time:$ perl -e 'print 123; print 456' # v5.14
gives the output:
The website says that the only difference between 'print' and 'say' is that 'say' appends NL after the string list while 'print' does not.
Is this a bug behavior of 'print' in perl v5.14 then?