in reply to Re: Undefined subroutine on ARM but not i686
in thread Undefined subroutine on ARM but not i686

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?

Replies are listed 'Best First'.
Re^3: Undefined subroutine on ARM but not i686
by almut (Canon) on Jun 01, 2009 at 22:42 UTC
    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.

        Your module is more modified than you stated. It's not possible to continue without seeing it.

        Works fine for me, even without the @EXPORT_OK change. You'll need to find out why the loop that starts with for $alg (1, 224, 256, 384, 512) doesn't get executed for you.

        Start by making sure you are loading the module you think you are loading. You can do so using

        use Cwd qw( realpath ); print(realpath($INC{'Digest/SHA/PurePerl.pm'}), "\n");

        If you are indeed executing the module you think you are executing, you've probably got a very serious problem with your Perl build.