For Programmers: Free Programming Magazines  


Home > Archive > PERL Beginners > November 2005 > Saving only Comments in HTML









You are viewing an archived Text-only version of the thread. To view this thread in it's original format and/or if you want to reply to this thread please [click here]

 

Author Saving only Comments in HTML
Oldbitcollector

2005-11-27, 9:55 pm

I'm using Simple::LWP to fetch an HTML page into @page.

I'm trying to find a way to save only infromation found between
<!-- and --> while discarding everything else.

In other words, I only want the comments from a the HTML documents
I'm retrieving. (strange huh?) The comments will be multi-lined in
most cases
so I also want the CR's.

I've got some nice code for stripping HTML tags
( $line =~ s/<.*?>//g; ) but can someone help me find a way to do this?

Thanks
Oldbitcollector

Sponsored Links







Also available: Server administration forum archive | Web Design forum archive | Software forum archive | Hardware reviews archive

Copyright 2008 codecomments.com