Using Git for Windows, which includes Perl v5.24.1, I have successfully used this code to test that my match works for specific occurrences of this sequence of redundant html:
open $HTML, '+<', $libFile . '.html' or die 'Failed to open' . $libFil +e . '.html'; my $matchspotter = 0; my $remove = m/<div><div class="blue"><\/div><\/div>/; while ( my $line = <$HTML> ) { if( $line =~ m/<div><div class="blue"><\/div><\/div>/ ) { $matchspotter += 1; } #$line =~ s/$remove//; #print $HTML $line; } print $matchspotter; close $HTML or die 'Failed to close' . $libFile . '.html';
The match stops working when the variable $remove is used in the if statement, but I only use the variable to illustrate my intent. The commented out lines are the bit I'm struggling with.
Searching has suggested this is silly to try without a cpan solution, but i would particularly like to try. (I've not yet used any modules, I would like to share with other Git users, and searching for the solution narrowed to a cpan module reduces useful hits.)
In reply to Strip specific html sequence by koober
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |