keyDemun has asked for the wisdom of the Perl Monks concerning the following question:
# Script name: srtiptag.pl # Purpose: Strips html a-href tags from a document # Author: keyDemun # http://c0depalace.netfirms.com/cgi-bin/cforum.pl print "STRIPPING A-HREF TAGS. PLEASE WAIT..\n"; open(FO,"@ARGV[0]") or print "File not found!\n"; while(<FO>) { $fc=$fc.$_; } close(FO); for($i=0;$i<length($fc);$i++) { $str=substr($fc,$i,1); if($str eq "<") { $st=substr($fc,$i,2); if($st eq "<a" || $st eq "<A") { while(substr($fc,$i,1) ne ">") { @hRef[$cnt]=@hRef[$cnt].substr($fc,$i,1); + $i++; } @hRef[$cnt]=@hRef[$cnt]."></a>"; $cnt++; } } } for($j=0;$j<$cnt;$j++) { print "\nHREF TAG-->[$j]-->@hRef[$j]\n\n"; }
Title edit by tye
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Is there a faster / more efficient / quicker or easier way to do this ?
by Hofmator (Curate) on Jan 09, 2003 at 12:47 UTC | |
|
Re: Is there a faster / more efficient / quicker or easier way to do this ?
by Zaxo (Archbishop) on Jan 09, 2003 at 12:41 UTC | |
|
Re: Is there a faster / more efficient / quicker or easier way to do this ?
by valdez (Monsignor) on Jan 09, 2003 at 12:58 UTC | |
by PodMaster (Abbot) on Jan 09, 2003 at 23:15 UTC | |
by Aristotle (Chancellor) on Jan 12, 2003 at 00:12 UTC | |
|
Re: Is there a faster / more efficient / quicker or easier way to do this ?
by jdporter (Paladin) on Jan 09, 2003 at 16:33 UTC |