Many thanks to everybody who replied to this thread, especially jhourcle who pointed out that I should be using SOAP for this.

The public nameserver idea was a good one, but alas my ISP required an IP address for external hosts.

So I used SOAP to take the db record on the client side, stick it into a data structure, send that over to ther server, recollect the data structure on the server side, then put it into MySQL over there. It works great.

Here is the code that does the job, in case anyone else can use it. In both cases it assumes that you supply a sub that converts the database record to/from a data structure and returns it to the client/server.

Keep yer stick on the ice...Steve

Client:

#!/usr/bin/perl -w use strict; use SOAP::Transport::HTTP; sub sendthread { my $id = shift; my $reply; my $servermsg; my $data = getfromdb($id); my $server = SOAP::Lite + -> uri('http://www.soaplite.com/Storeit') + -> proxy('http://your.ip.net/cgi-bin/soapserver.cgi', timeout => + 30); eval { $servermsg = $server->store($id,$data); }; if ($@) { # eval error $reply = $@; } elsif ($servermsg->fault) { # server fault $reply = join ', ', $servermsg->faultcode, $servermsg->faultstr +ing, $servermsg->faultdetail; } else { # everything OK $reply = $servermsg->result(); } return $reply; }
soapserver.cgi
#!/usr/bin/perl -w use strict; use SOAP::Transport::HTTP; SOAP::Transport::HTTP::CGI -> dispatch_to('Storeit') -> handle; package Storeit; sub store { my ($class,$id,$data) = @_; my $response = storetodb($id,$data); return $response; }

In reply to Re^2: Sending Storable strings over http by cormanaz
in thread Sending Storable strings over http by cormanaz

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.