in reply to How to decide if an HTML is expendable?

Another useless use of /o.

(added)Far More Than Everything You've Ever Wanted to Know about Prototypes in Perl and When to use Prototypes? - in this case you shouldn't

Now with that out of the way, the general problem is to decide whether you have non-markup text. You could further generalize and include images in your "non-blank" idea but that just makes life harder. I'd probably want you to use something like HTML::TokeParser and make your markup/non-markup decisions that way. For the moment though, this will work, sort-of. You should decide whether you want to use my cheap-n-dirty test or do it properly.

sub isHTMLEmpty { my $filename = shift; local *HTML; local $/; open HTML, "<", $filename or die "Couldn't open $filename for read +ing: $!"; my $html = <HTML>; close HTML; $html =~ s(<[^>]*>)()g; $html =~ s/\s+//g; return !! $html; }