Use a lookahead:
print split '\.(?=[^.]*$)', $_ for 'x.y', 'x.y.z';; x y x.y z
In reply to Re: split giving me a splitting headache
by BrowserUk
in thread split giving me a splitting headache
by Anonymous Monk
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |