use strict; use warnings; my $str='$DOMAIN{HOST},$DOMAIN{IP},$DOMAIN{CONFIG}'; my @result = $str =~ /{(.+?)}/g; print "@result\n";