in reply to Re: split/map weirdness: empty strings vs undef
in thread split/map weirdness: empty strings vs undef
Almost. As blakem said, you have to escape the pipe. Maybe more importantly though, the trailing empty fields will disappear in a puff of smoke.
perl -le 'map { print defined($_) ? "def" : "undef" } split(/\|/, "2|3 +|||||"); def def
-sauoq "My two cents aren't worth a dime.";
|
|---|