Necos has asked for the wisdom of the Perl Monks concerning the following question:
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... Necossub 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; }
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
(tye)Re: RPC
by tye (Sage) on May 05, 2001 at 07:53 UTC | |
by Necos (Friar) on May 08, 2001 at 04:17 UTC | |
by tye (Sage) on May 08, 2001 at 05:30 UTC | |
by Necos (Friar) on May 09, 2001 at 03:08 UTC | |
|
Re: RPC
by converter (Priest) on May 05, 2001 at 05:18 UTC | |
by tilly (Archbishop) on May 05, 2001 at 19:03 UTC |