my $str = "((mouse,rat),(human,chimp))"; $str =~ s/\(/\[/g; $str =~ s/\)/]/g; print "$str\n"; my $aoa = eval($str);