That scalar string has several embedded \n, as if it is a here document. You can remove everything from the first ‘*’ to the end of the string with:
$stval =~ s/[*\n]+.+//g; # this removes all * Characters
That scalar string has several embedded \n, as if it is a here document. You can remove everything from the first ‘*’ to the end of the string with:
$stval =~ s/[*\n]+.+//g; # this removes all * Characters