Beefy Boxes and Bandwidth Generously Provided by pair Networks
Perl: the Markov chain saw
 
PerlMonks  

Re: Dividing HTML up into chunks

by srawls (Friar)
on Jun 28, 2001 at 06:09 UTC ( [id://92155]=note: print w/replies, xml ) Need Help??


in reply to Dividing HTML up into chunks

Note: untested code, written as I post.
open FH, "$file"; { local $/; $text = <FH>; } for($text =~ /<A NAME="([^"]+)">(.*?)(?!<A NAME=")/) { #file name is $1 #text is $2 }
Note, I saved time and used .*?. See death to dot star for why not to do that. Also, look at unrolling the loop. I leave that as an exercise to you, because I can't just hand you everything now can I : )

The 15 year old, freshman programmer,
Stephen Rawls

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://92155]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others drinking their drinks and smoking their pipes about the Monastery: (5)
As of 2024-03-28 20:15 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found