my $set = $res[0]; #I use a lot of 'extra' variables to tell me what everything is $set =~ s/[\(\)]//g; #remove all parentheses my @values = split(',', $set); #now every value should have its own spot in the array