Your split expression as written works for me:
$ perl -E 'say join ":", split /(-| )/, "SMITH-JONES";' SMITH:-:JONES
Can you provide an SSCCE?
Update: There's a lot in your supplied code which looks suspiciously incorrect, I'm afraid. The open brace after the split has no matching closing brace and =. is not the concatenation operator, for example.
In reply to Re: Split confusion
by hippo
in thread Split confusion
by swampyankee
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |