Nagarjuna has asked for the wisdom of the Perl Monks concerning the following question:
The following perl code should print
A B:C D
A B
C D
but instead it prints
A B:C D
A
B
C
D
I have used split before and never noticed such behavior.
I got the same problem on
perl v5.6.1 running on Red Hat Linux release 7.3 (Valhalla) (2.4.33.2)
and
perl v5.14.2 running on Ubuntu 12.04.5 LTS (3.5.0-54-generic)
Am I missing something ?
Thank you
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: split(/:/, $t) splits also on white space
by Loops (Curate) on Sep 25, 2014 at 11:25 UTC | |
|
Re: split always splits also on white space (Perl v5.14.2) Ubuntu (12.04)
by Anonymous Monk on Sep 25, 2014 at 10:15 UTC | |
by Anonymous Monk on Sep 25, 2014 at 10:19 UTC | |
by Nagarjuna (Initiate) on Sep 25, 2014 at 11:37 UTC |