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: Beginner:
Print text between <source> and </source>

 



Gustaf
New User

Feb 14, 2013, 2:17 AM

Post #1 of 2 (326 views)
Print text between <source> and </source> Can't Post

Hello,

I'm new to perl and I would like to extract text between to strings. I would like to print all texts between <source> and </source> in a text file. The <source> and </source> could be on different rows.

Ex1
====
<source>Test</source>

=> print Text

Ex2
====
<source>Test1
av test1</source>
<source>Test2</source>

=> Print Test1
av test1
Test2


Thanks
Gustaf


BillKSmith
Veteran

Feb 14, 2013, 11:15 AM

Post #2 of 2 (319 views)
Re: [Gustaf] Print text between <source> and </source> [In reply to] Can't Post

This can be surprisingly difficult. I am sure it is worth the effort to search CPAN for a module that parses HTML. Perhaps someone else can recommend a specific one.
Good Luck,
Bill

 
 


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

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