in reply to Client/Server Messaging
#!/usr/bin/perl use IO::All; use Storable qw/thaw/; my $s = io(':55555')->fork->accept; my $l = $s->getline; ( my $size ) = $l =~ /(^\d+)/; my $data; $s->read( $data, $size ) || die $!; my @data = @{ thaw($data) }; $s->print( $data[1] );
#!/usr/bin/perl use IO::All; use Storable qw/freeze/; my @data = qw/hello world/; my $data = freeze( \@data ); my $io = io('localhost:55555'); $io->print( length($data), "\n", $data ); print $io->getline;
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
| A reply falls below the community's threshold of quality. You may see it by logging in. | |
| A reply falls below the community's threshold of quality. You may see it by logging in. |