in reply to clearing spaces from data input

You said you have tried split /,\s*/, but that it didn't work. In that case your computer or your perl is severely broken.

By the way, maybe you should consider using standard CSV or another well-known method of having plain text data (XML? YAML?)

2;0 juerd@ouranos:~$ perl -e'undef christmas' Segmentation fault 2;139 juerd@ouranos:~$