Ok, I wrote some simple code to show this, and managed to narrow the problem down a little. Here is the code:

This is the server:

#!/usr/bin/perl -w use strict; use Frontier::Daemon; use Digest::MD5 qw/md5_hex/; Frontier::Daemon->new (LocalPort => 12345, methods =>{md5=>sub {return md5_hex (shift)}}); __END__

And the client:

#!/usr/bin/perl -w use strict; use Frontier::Client; my $rpc = Frontier::Client->new (url =>"http://localhost:12345/RPC2"); print $rpc->call ("md5", "1234"), $/; __END__

For reference:

md5 of "1234": 81dc9bdb52d04dc20036dbd8313ed055
md5 of "": d41d8cd98f00b204e9800998ecf8427e

Now, here's what I found. If I run the server on my desktop (perl 5.8.0), I get the expected result (81dc..). If I run the server on an older system (perl 5.6.1), I get the erroneous one (d41d..), along with the error on the console:

Use of uninitialized value in subroutine entry at ./srv line 8.

I have also found that even in the older system, the following code works:

sub my_md5_hex { my ($str) = @_; my $cmd = "perl -MDigest::MD5 -e " . "'print Digest::MD5::md5_hex (\"$str\"), \$/'"; my $md5 = `$cmd`; chomp ($md5); return $md5; }

It's pretty gross, though.


In reply to Re: Re: Frontier::RPC and Digest::MD5 by v_thunder
in thread Frontier::RPC and Digest::MD5 by v_thunder

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.