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