[Omaha.pm] A split-ting headache...

Dave M dave.nerd at gmail.com
Sun Jul 16 10:18:04 PDT 2006


I just spent an hour trying to turn:

$string = 'foo|bar|blah|stuff|crap';

into:

$new_string = 'foo\nbar\nblah\nstuff\ncrap';

Unfortunately I was using "split" in the same manner as "join", which
doesn't fly:

$new_string = join("\n", split("|", $string));

Of course, it should be:

$new_string = join("\n", split(/\|/, $string));

Sigh...

dave


More information about the Omaha-pm mailing list