Hi again,
Ugh: please ignore my previous example, which split on the empty
string by mistake (it's even evident in the script you quoted).
Thwack...
Let me try and pull this together: splitting on a string containing
a single space is special in a do what you probably mean way: it's
On Wed, Jul 19, 2006 at 12:29:04AM +0200, ende wrote:
Why?
$a = 1 2 3;
1 2 3
split / /, $a;
[1, , 2, 3]
split , $a;
[1, 2, 3]
Splitting on / / is different from splitting on because is
magickal. While this is mentioned in the docs for split(), it could
perhaps
Why?
$a = 1 2 3;
1 2 3
split / /, $a;
[1, , 2, 3]
split , $a;
[1, 2, 3]
--
Juan Falgueras
Profesor del Depto. de Lenguajes y Ciencias de la Computación
Universidad de Málaga
Ende asked...
Why?
$a = 1 2 3;
1 2 3
split / /, $a;
[1, , 2, 3]
split , $a;
[1, 2, 3]
Using a single space as the string on which to split triggers a
special case: from perldoc -f split
specifying a PATTERN of space (' ') will