Sorry for the inconvenience, I want the exact opml text from the file in my string like this:

<?xml version="1.0" encoding="ISO-8859-1"?> <opml version="2.0"> <head> <title>workspace.userlandsamples.doSomeUpstreaming</title> <dateCreated>Mon, 11 Feb 2002 22:48:02 GMT</dateCreated> <dateModified>Sun, 30 Oct 2005 03:30:17 GMT</dateModified> <ownerName>Dave Winer</ownerName> <ownerEmail>dwiner@yahoo.com</ownerEmail> <expansionState>1, 2, 4</expansionState> <vertScrollState>1</vertScrollState> <windowTop>74</windowTop> <windowLeft>41</windowLeft> <windowBottom>314</windowBottom> <windowRight>475</windowRight> </head> <body> <outline text="Changes" isComment="true"> <outline text="1/3/02; 4:54:25 PM by DW"> <outline text="Change &quot;playlist&quot; to &quot;ra +dio&quot;."/> </outline> <outline text="2/12/01; 1:49:33 PM by DW" isComment="true" +> <outline text="Test upstreaming by sprinkling a few fi +les in a nice new test folder."/> </outline> </outline> <outline text="on writetestfile (f, size)"> <outline text="file.surefilepath (f)" isBreakpoint="true"/ +> <outline text="file.writewholefile (f, string.filledstring + (&quot;x&quot;, size))"/> </outline> <outline text="local (folder = user.radio.prefs.wwwfolder + &q +uot;test\\largefiles\\&quot;)"/> <outline text="for ch = 'a' to 'z'"> <outline text="writetestfile (folder + ch + &quot;.html&qu +ot;, random (1000, 16000))"/> </outline> </body> </opml>

use my perl code print out in console I got:

<opml ve</opml>2</body>e</outline>ext="writetestfile (folder + ch + &q +uot;.html&quot;, random (1000, 16000))"/>lder."/>
it seems like a encoding problem, which I have no experience. So I wonder, how do I read such a file and properly stored in a perl string? This is a homework. Am not allow to use any module.


In reply to Re^2: *.opml file output to console problem by Anonymous Monk
in thread *.opml file output to console problem by Anonymous Monk

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • 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:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.