in reply to How to split

What code did you try? See

perldoc -f split split /PATTERN/,EXPR,LIMIT split /PATTERN/,EXPR split /PATTERN/ split Splits the string EXPR into a list of strings and returns that list. By default, empty leading fields are preserved, and empt +y trailing ones are deleted. (If all fields are empty, they are considered to be trailing.)