in reply to string to array

Splitting a string into parts. There is a function for that called split

$string=~s/\[(.*)\]/$1/; #removing [] @numbers= split /,/,$string;