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