Clear questions and runnable code get the best and fastest answer |
|
PerlMonks |
Re4: split/map weirdness: empty strings vs undefby blakem (Monsignor) |
on Oct 05, 2002 at 09:02 UTC ( [id://203014]=note: print w/replies, xml ) | Need Help?? |
Argh... I thought I could do better, but to get your exact results, all I could come up with was:
That second line can get a bit simpler if you define an empty string to have zero fields instead of having a single null field. Congrats, your solution is better than mine even though it looks unnecessarily complicated. I think the best suggestion so far is to tell split how many fields you want: Though I'd probably break it up into two lines:
-Blake
In Section
Seekers of Perl Wisdom
|
|