cromiumlake has asked for the wisdom of the Perl Monks concerning the following question:
the text loaded from "555 timer.html":#----------------------------------- #!/usr/bin/perl use strict; use warnings; # use re 'debug'; my $workingfolder = '/home/crom/Documents/perl_scripts/html_cleaner/te +st'; my $file_name = '555 timer.html'; my $link = '<a.*(?=<\/a>)<\/a>'; my $re_link = qr/$link/; open(FILEVAR, "<$workingfolder/$file_name") or die "cannot open $file_ +name: $!"; my @html = ''; while(<FILEVAR>){ chomp $_; push(@html, $_); } close FILEVAR; &filters(@html); foreach $_ (@html) {print "$_"} exit(0); sub filters { (@html) = @_; foreach $_ (@html) { if ($_ =~ /$re_link/gis) { $_ =~ (s/$re_link//gis); } } return(@html); } #-----------------------------------
well if you try it you will see that the "RESET" line always remains grrrrrrrrrr Any ideas apart from nuke it? :)<tr> <td><img src="./555 timer_files/g_red_an.gif" border="0" width="12" he +ight="12"> <a href="https://homepages.westminster.org.uk/electronics/ +555.htm#reset"><em>RESET input</em></a></td> <td><a href="https://homepages.westminster.org.uk/electronics/555.htm# +links"><img src="./555 timer_files/g_red_an.gif" border="0" width="12 +" height="12"></a> <em><a href="https://homepages.westminster.org.uk/electronics/555.htm# +links">LINKS . . .</a></em></td> </tr> #-----------------------------------
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Anchor parsing
by moritz (Cardinal) on Aug 01, 2011 at 13:28 UTC | |
|
Re: Anchor parsing
by jethro (Monsignor) on Aug 01, 2011 at 14:22 UTC |