in reply to Undefined subroutine on ARM but not i686

Out of curiosity, what do you get from adding
print "$_\n" for @Digest::SHA::PurePerl::EXPORT_OK;

There's nothing conditional in building the subs, so I don't see how sha256 could be missing.

Try changing
eval($fcn);
to
eval("$fcn; 1") or die $@;

Replies are listed 'Best First'.
Re^2: Undefined subroutine on ARM but not i686
by cbanker (Beadle) on Jun 01, 2009 at 22:25 UTC
    Here's the output I get from that command:
    hmac_sha1 hmac_sha1_base64 hmac_sha1_hex hmac_sha224 hmac_sha224_base64 hmac_sha224_hex hmac_sha256 hmac_sha256_base64 hmac_sha256_hex hmac_sha384 hmac_sha384_base64 hmac_sha384_hex hmac_sha512 hmac_sha512_base64 hmac_sha512_hex sha1 sha1_base64 sha1_hex sha224 sha224_base64 sha224_hex sha256 sha256_base64 sha256_hex sha384 sha384_base64 sha384_hex sha512 sha512_base64 sha512_hex
    For the second part, assuming you meant to change the code like this:
    #!/usr/bin/perl use Digest::SHA::PurePerl; my $shad = eval("Digest::SHA::PurePerl::sha256('test');1") or die $@; print "SHA value: ", $shad, "\n";
    Here's the output I get:
    Undefined subroutine &Digest::SHA::PurePerl::sha256 called at (eval 3) + line 1.
    As far as I can tell those outputs don't seem to show anything too valuable other than the fact that the exports are there. Any other ideas?
      For the second part,...

      I think he meant the place in PurePerl.pm, where @EXPORT_OK is being populated (line 774):

      eval($fcn); push(@EXPORT_OK, 'sha' . $alg . $suffix_extern[$i]);

      This would allow you to see if/how the eval failed...

        No additional output is produced when I changed both of the eval($fcn) commands near 774.

        One thing to note is that to get this to actually export the functions, I had to copy the export block from the SHA.pm module like below, otherwise, I would get errors when trying to import the function names.
        @EXPORT_OK = qw( hmac_sha1 hmac_sha1_base64 hmac_sha1_hex hmac_sha224 hmac_sha224_base64 hmac_sha224_hex hmac_sha256 hmac_sha256_base64 hmac_sha256_hex hmac_sha384 hmac_sha384_base64 hmac_sha384_hex hmac_sha512 hmac_sha512_base64 hmac_sha512_hex sha1 sha1_base64 sha1_hex sha224 sha224_base64 sha224_hex sha256 sha256_base64 sha256_hex sha384 sha384_base64 sha384_hex sha512 sha512_base64 sha512_hex);
        With this block commented out, printing out the export list gives no output.