You don't say what substring it should come after, and this does smell suspiciously much like homework, but you should definitely take a look at split:
$text = 'So, I went to the $string and I wanted to buy a book, but it
+was too expensive,';
@phrases = split /,/, $text;