This has nothing to do with why your test(s) are failing... but while looking into the code to figure out if you're really depending on Crypt::Rijndael (or if that require Crypt::Rijndael was maybe just a misguided attempt to load the module only if available (which wouldn't work... but doesn't seem to be the case here)), I incidentally noticed that you might simplify your hex <--> bin conversions

sub yubikey_hex2bin { my $in = $_[0]; my $out = ""; for(my $k=0;$k<length($in);$k+=2) { $out .= chr(hex(substr($in,$k,2))); } return $out; } sub yubikey_bin2hex { my $in = $_[0]; my $out = ""; for(my $k=0;$k<length($in);$k++) { $out .= sprintf("%2x",ord(substr($in,$k,1))); } $out =~ s/ /0/g; # this is a hack.. not sure why it has + to be like this... return $out; }

by using the Perl builtins un/pack with the "H" template, i.e.

# hex2bin $bin = pack "H*", $hex; # bin2hex $hex = unpack "H*", $bin;

Or, if you wanted to stick with your conversion routines, you could get rid of the $out =~ s/ /0/g hack by using "%02x" in sprintf().

Yeah, I know you didn't ask for a code review, so my apologies, if this advice is unsolicited... :)


In reply to Re: My first module is failing on CPAN by almut
in thread My first module is failing on CPAN by Massyn

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.