CGI/Perl Guide | Learning Center | Forums | Advertise | Login
Site Search: in

  Main Index MAIN
INDEX
Search Posts SEARCH
POSTS
Who's Online WHO'S
ONLINE
Log in LOG
IN

Home: Perl Programming Help: Intermediate:
About search script

 



pinks
Deleted

Sep 24, 2000, 2:38 AM

Post #1 of 3 (428 views)
About search script Can't Post

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

Post #2 of 3 (428 views)
Re: About search script [In reply to] Can't Post

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

Post #3 of 3 (428 views)
Re: About search script [In reply to] Can't Post

thanks Henning

Its working

 
 


Search for (options) Powered by Gossamer Forum v.1.2.0

Web Applications & Managed Hosting Powered by Gossamer Threads
Visit our Mailing List Archives