If you want each of the parts to end up as a valid html file on its own, this could be a very tricky process. An html parsing module would be required, along with a fairly good knowledge of the original html structure and content, and some fairly clear and detailed notions about how to establish cut-off points and how to distribute information among the output files. It could get very ugly.
If you just want to break a stream of bytes into two or more pieces, such that when the pieces are put together again you get the original file, then it's just a question of how many pieces you want, or (equivalently) how large each piece should be, copying right quantity of data from the input to each distinct output file.
So, what are you actually trying to accomplish by splitting an html file into pieces?
Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
Read Where should I post X? if you're not absolutely sure you're posting in the right place.
Please read these before you post! —
Posts may use any of the Perl Monks Approved HTML tags:
- a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
| |
For: |
|
Use: |
| & | | & |
| < | | < |
| > | | > |
| [ | | [ |
| ] | | ] |
Link using PerlMonks shortcuts! What shortcuts can I use for linking?
See Writeup Formatting Tips and other pages linked from there for more info.