in reply to split problem when emptiness is a valid element
$ perl -le 'print for map "<$_>", split /,/, "a,b,c,,,,"' <a> <b> <c> $ perl -le 'print for map "<$_>", split /,/, "a,b,c,,,,FOO"' <a> <b> <c> <> <> <> <FOO>
Update: now, of course inman's solution is a superior one and to all effects the right(TM) one, I'd say. I knew about this use of the LIMIT parameter, but for some reason it didn't spring to mind...
|
|---|