in reply to Re: Wierd funky problems with split
in thread Wierd funky problems with split
Instead of giving you,$a = "12||23||34||45"; @a = split("\|\|", $a); print join(",", @a);
It gives you12,23,34,45
You have to say:1,2,|,|,2,3,|,|,3,4,|,|,4,5
Or, if you want to use quots, say:$a = "12||23||34||45"; @a = split(/\|\|/, $a); print join(",", @a);
The reason is simple:$a = "12||23||34||45"; @a = split("\\|\\|", $a); print join(",", @a);
|
|---|