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