Home: Perl Programming Help: Intermediate:
About search script



pinks
Deleted

Sep 24, 2000, 2:38 AM


Views: 1396
About search script

Hi!

I am writing a script which searches certain word in an HTML file. I want such a code which SHOULD NOT search within < and > tags.

Can any one help me around

thanks


Henning Koch
Deleted

Sep 25, 2000, 5:28 AM


Views: 1396
Re: About search script

First, read in the HTML file you want to search:

$html;

open(htmlFile, 'mypage.html');
$html = join("", <htmlFile> );
close(htmlFile);

Then strip all <tags> from the HTML:

$html =~ s/<[^>]+>//g;

Then do your search on $html.

HTH,
Henning

------------------
PerlBall - Free Perl Source Code Compressor
Reduce your scripts to up to 15% of their original size!

[This message has been edited by Henning Koch (edited 09-25-2000).]


pinks
Deleted

Sep 26, 2000, 10:26 AM


Views: 1396
Re: About search script

thanks Henning

Its working