#!/usr/bin/perl use strict; use warnings; #824315 my $html; { local undef $/; # slurp the data (file for your application) $html = ; } my $delete = "
.*?
"; my $tobedeleted; if ( $html =~ m|($delete)|s ) { $tobedeleted = $1; print "\n---------\n \$tobedeleted: $tobedeleted\n--------\n\n"; # above for info only; remove for production $html =~ s|$tobedeleted| |; } else { print "\n No match for class topsearchbar \n"; } print $html; __DATA__ something

Headline above search bar

foo bar logo for xyz corp baz

more stuff

stuff