If you use the third split parameter it will do the trick. A value of 5 works for your example, but any value larger also works which is useful if you are not sure how many fields there are:
print "'$_'" for split '[*]{2}', $s, 100;; '123' 'abc' '' '' ''
In reply to Re: Split a string with multiple trailing delimeters?
by BrowserUk
in thread Split a string with multiple trailing delimeters?
by haolecoder
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |