You might find it easier to use a regular expression. try perlretut for a start.
In reply to Re: Proper use of split by RichardK in thread Proper use of split by th3j4ckl3