I have 2 programs: 1 client, 1 server. (simple, right?). I came across the RPC and MSG modules written in Advanced Perl Programming and put them to use. I have written a routine that looks like:
sub checkuser { my $obj = shift; my $FN = foo::get_attr($obj , 'FIRST_NAME'); my $LN = foo::get_attr($obj , 'LAST_NAME'); my $USERS; my @USERS; my $line = ""; open( 'USERS' , 'file' ); while ( $line = <USERS> ) { chomp($line); my @parser = (); my $item = ""; @parser = split( /,/ , $line); foreach $item (@parser) { $item =~ s/^\s+//; $item =~ s/\s+$//; } push (@USERS, \@parser); $USERS = @USERS; } close('USERS'); my $i = 0; my $return_result; while ( $i < $USERS ) { my $FNT = $USERS[$i][1]; my $LNT = $USERS[$i][0]; if ( ( $FN =~ /\Q$FNT/i) && ( $LN =~ /\Q$LNT/i) ) { $return_result = 1; return ($USERS[$i]->[0] , $USERS[$i]->[1]); } else { $return_result = "User not found"; } $i++; } return $return_result; }
I had this code reviewed by others as well as reviewing it myself. It works fine when running on the client (the above sub is server code) as part of the client (i.e., inserted in the client program). When I put the server code back on the server, then call the command via RPC ($client->rpc('checkuser' , $obj), which is the client calling the sub from the server), the client hangs. I figure I am missing something very simple here. I've looked at the modules, and from what I gather, I am using it properly. The only thing that would make sense to me is that I am passing a blessed hash (which should not matter), $obj to the checkuser sub. Any help will be appreciated... Necos

In reply to RPC by Necos

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.