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.10will print:
123456 # no NL appendedBut 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.14gives the output:
123 # NL appended 456
http://www.perl.com/pub/2008/04/23/a-beginners-introduction-to-perl-510.html
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?
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Bug for the 'print' function in perl v5.14?
by Corion (Patriarch) on Sep 24, 2012 at 17:36 UTC | |
by Diamondust (Novice) on Sep 25, 2012 at 00:31 UTC | |
|
Re: Bug for the 'print' function in perl v5.14?
by toolic (Bishop) on Sep 24, 2012 at 17:26 UTC | |
by Diamondust (Novice) on Sep 25, 2012 at 00:20 UTC | |
|
Re: Bug for the 'print' function in perl v5.14?
by tobyink (Canon) on Sep 24, 2012 at 19:21 UTC | |
by Diamondust (Novice) on Sep 25, 2012 at 00:37 UTC | |
|
Re: Bug for the 'print' function in perl v5.14?
by frozenwithjoy (Priest) on Sep 24, 2012 at 17:26 UTC |