my $html = "

Foo

Bar

Some more text here

"; my @list = ('Foo','Bar'); # eat up the bits in @list $html =~ m/$_/gc for @list; #use \G to match the rest ($rest) = $html =~ m/\G(.*)$/; print $rest;