[PLUG] Working with learning Perl by Randal Schwartz...
Michael C. Robinson
michael at goose.robinson-west.com
Sat Oct 25 13:38:02 UTC 2003
Upgrading to the same version of perl worked. My web server
must still be using the old 5.6.0 directory.
Redhat 7.2 seemed to take 7.3's perl just fine.
#!/usr/bin/perl
use Net::EasyTCP;
#
# Create a new client and connect to a server
#
$client = new Net::EasyTCP(
mode => "client",
host => 'web.robinson-west.com',
port => 2345,
)
|| die "ERROR CREATING CLIENT: $@\n";
# Send and receive complex objects/strings/arrays/hashes by reference
%hash = ("Send 1" => "Reply 1" , "Send 2" => "Reply 2");
$client->send(\%hash) || die "ERROR SENDING: $@\n";
$reply = $client->receive() || die "ERROR RECEIVING: $@\n";
foreach (keys %{$reply}) {
print "Received key: $_ = $reply->{$_}\n";
}
I don't get the %hash line. Is $client->send a function call?
I've never seen => before in a perl script.
What was actually send verses received here?
-- Michael Robinson
More information about the PLUG
mailing list