in reply to Split confusion
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.
|
|---|