in reply to Re^3: how to search and replace the match with specific number of times in a string
in thread how to search and replace the match with specific number of times in a string

That's one way, but I think a negative look-ahead would serve you better in this specific case:
$s =~ s/\*(?!\n)/*\n/;
Also, you don't need to escape the * in the replacement string.