# $page refers to the variable containing the text my @comments = Dumper($page) =~ m/[=]+Comments[=]+.*?\n(.*?)[=]+/gs;