$content = ""; while ($content =~ m[(<.+?>)]g) { print $1."\n"; }