Digging into this further, I found that Digest::SHA actually uses straight Perl to do the reading. When tried when Digest::SHA1, which uses PerlIO_read in XS like Digest::MD5, it fails. Perhaps the original question should have been: Can I use tied filehandles with XS modules that use PerlIO_read, and if so, how?

I found this post: http://stackoverflow.com/questions/13624061/how-do-i-use-tied-filehandles-from-perl-xs-code in which it seems they had to modify the XS. Am I out of luck here? Should I just put a warning in the POD about using it with XS-based modules? Or is there another way to do what I want (a class that can act like a filehandle) without using tied filehandles and which would be compatible with PerlIO_read?


In reply to Re: Digest::MD5 addfile() w/ tied filehandle by jdv
in thread Digest::MD5 addfile() w/ tied filehandle by jdv

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.