# @markers already holds each marker in each array spot #$htmlfile already has the text of my html file foreach my $m (@markers){ $htmlfile =~ s/\G]+)"?>//gi; }