Beefy Boxes and Bandwidth Generously Provided by pair Networks
Clear questions and runnable code
get the best and fastest answer

Re: Dividing HTML up into chunks

by srawls (Friar)
on Jun 28, 2001 at 06:09 UTC ( #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?

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://92155]
[LanX]: seems like my boss has activated an extra UTF8 encoding such that my JSON stuff arives twice encoded in the browser ... oO
[LanX]: he loves to do this with regexes ...
LanX considers looking for a new project ...

How do I use this? | Other CB clients
Other Users?
Others contemplating the Monastery: (4)
As of 2018-03-19 23:24 GMT
Find Nodes?
    Voting Booth?
    When I think of a mole I think of:

    Results (246 votes). Check out past polls.