I am unclear on how you plan to find this character's position. But if you can, then you can read lines and use substr to pull out the character, you can use seek to reset your position in the file. In perlvar you can find $/, which can be handy for reading to specific positions. (Alternately you can read through it and then find the stuff you want manually.) And if you want you can have the filehandle tell you where it is in the file.

Before playing with this stuff, if you are on Windows it is highly recommended that you first binmode.

And by the time you are done, well you probably will understand file manipulation in more detail than you do now...

Of course if the file is small, you can just slurp it into a string and make your life much, much easier...


In reply to Re (tilly) 1: Jumping in over my head again by tilly
in thread Jumping in over my head again by bsummerer

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.