Seems like a bug to me :) http://grep.cpan.me/?q=No+filehandle+passed -> https://metacpan.org/source/RJBS/perl-5.22.0/cpan/Digest-MD5/MD5.xs.... -> Perl_sv_2io(pTHX_ SV *const sv)

#!/usr/bin/perl -- package TieTest; sub TIEHANDLE { return bless {}, shift } sub OPEN { open my $fh, $_[1], $_[2]; $_[0]->{fh} = $fh; } sub READ { warn "...tied read\n"; read $_[0]->{fh}, $_[1], $_[2], + $_[3]; } sub SEEK { seek $_[0]->{fh}, $_[1], $_[2]; } package main; use strict; use warnings; use Digest::MD5; use Digest::Perl::MD5; my $filename = $ARGV[0] || __FILE__; open FH_PLAIN, '<', $filename or die $!; #open FH_TIED, '<', $ARGV[1]; # try uncommenting this tie(*FH_TIED, 'TieTest'); open FH_TIED, '<', $filename or die $!; open FH_EEP, '<', $filename or die $!; tie(*FH_EEP, 'TieTest'); open FH_EEP, '<', $filename or die $!; my %handles = ( PLAIN => \*FH_PLAIN, TIED => \*FH_TIED, EEP => \*FH_EEP, PEE => eval { my $pee; tie $pee, 'TieTest'; open $pee, '<', $filename or die $!; $pee; }, ); for my $title ( keys %handles ){ my $fh = $handles{$title}; for my $class (qw/Digest::Perl::MD5 Digest::MD5/) { my $sum = eval { $class->new->addfile($fh)->hexdigest } || $@; printf "%-7s%-19s%-32s\n", $title, $class, $sum; seek $fh, 0, 0; } } #~ use Devel::Peek qw/ Dump /; Dump( $_) for values %handles ; ## unin +formative __END__ $ perl perliotiehandle.pl Odd number of elements in hash assignment at perliotiehandle.pl line 4 +4. ...tied read ...tied read EEP Digest::Perl::MD5 623cf1cdac049dc6527cb0f28fc5aa76 EEP Digest::MD5 623cf1cdac049dc6527cb0f28fc5aa76 PLAIN Digest::Perl::MD5 623cf1cdac049dc6527cb0f28fc5aa76 PLAIN Digest::MD5 623cf1cdac049dc6527cb0f28fc5aa76 ...tied read ...tied read TIED Digest::Perl::MD5 623cf1cdac049dc6527cb0f28fc5aa76 TIED Digest::MD5 No filehandle passed at perliotiehandle.pl l +ine 56. PEE Digest::Perl::MD5 Digest::Perl::MD5 read failed: Bad file desc +riptor at C:/citrusperl/site/lib/Digest/Perl/MD5.pm line 164. Can't use an undefined value as a symbol reference at perliotiehandle. +pl line 58.

In reply to Re^2: Digest::MD5 addfile() w/ tied filehandle by Anonymous Monk
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.