in reply to string to array

I think the best way is to use regular expressions (strongest and useful characteristic in perl) or even sprintf.

I'll recomend you to take a look at PerlRE first