in reply to Re^3: Match text from txt to htmlin thread Match text from txt to html
this is my code as of now.
my $html = shift;
open(my $fh, '<', $html) or die "cannot open file $html";
$htmlvar = <$fh>;
my $line = 1;
if ($htmlvar =~ /$_/ && $htmlvar !~ /<sentence id\"[0-9]*\">$_<\/
$htmlvar =~ s/($_)/<sentence id\"$line\">$1<\/sentence>/;
When open fails, get it to tell you why:
open(my $fh, '<', $html) or die "cannot open file $html: $!";
Trying to parse HTML like this is more often than not a waste of time.
A photo of people (family, friends, myself, ...)
A photo of my pet(s)
A photo of something man-made (cars, machines, etc.)
A photo of nature, space, or something else not man-made
An abstract pattern
Artwork, digital or photographed
A solid color
A digital animation
Whatever my desktop environment has set for me by default
I haven't seen my background in weeks, too many windows covering it!
Results (46 votes). Check out past polls.