Right. And we should get rid of the entire idea of filehandles-as-objects from perl6. Or is that the way we're going? I can't keep up.

Instead, as reasonablekeith reasonably pointed out, the solution really is to RTFM. Looking at IO::File shows that it derives from IO::Seekable, among others. Since that seemed like a logical next place to look, I went there, found the documentation on getpos, and saw that setpos was right there as well. I tried it out, and it worked wonderfully. I went to post, and noticed that reasonablekeith already had posted exactly that, so I left it alone.

(Alternate ways of doing things ++. Snide remarks about using a standard module --. Extending the argument ad absurdum, you get the idea to parse XML with built-in regular expressions in perlre because all the XML modules have their own and slightly different view of things and how things should work, when RTFM'ing will still get the job done quickly and reliably.)


In reply to Re^2: HowTo retrieve the position in a file from the FH by Tanktalus
in thread HowTo retrieve the position in a file from the FH by jeanluca

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.