in reply to Search and replace everything except html tags
If you actually want to separate into tags and text:use strict; open FILE, "<temp.html"; my @tags = grep /^<.*>$/, <FILE>; print @tags;
use strict; open FILE, "<temp.html"; my (@tags, @text); while (<FILE>) { chomp; if (/^<.*>$/) { push @tags, $_; } else { push @text, $_; } } print "Tags:\n", join "\n", @tags; print "\nText:\n", join "\n", @text;
|
|---|