this is my code as of now.
#!/usr/bin/perl use warnings; my $html = shift; my $htmlvar; open(my $fh, '<', $html) or die "cannot open file $html"; { chomp; local $/; $htmlvar = <$fh>; } close($fh); my $line = 1; while (<STDIN>){ chomp; if ($htmlvar =~ /$_/ && $htmlvar !~ /<sentence id\"[0-9]*\">$_<\/ +sentence>/){ $htmlvar =~ s/($_)/<sentence id\"$line\">$1<\/sentence>/; $line++ } } print "$htmlvar\n";
In reply to Re^4: Match text from txt to html
by corfuitl
in thread Match text from txt to html
by corfuitl
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |