For Programmers: Free Programming Magazines  


Home > Archive > PERL Programming > February 2005 > can i send array via IO::SOCKET?









You are viewing an archived Text-only version of the thread. To view this thread in it's original format and/or if you want to reply to this thread please [click here]

 

Author can i send array via IO::SOCKET?
volant

2005-02-21, 12:28 am

hi,
i m trying to send an array thru IO::socket.

my coding is as below:

for client side:

my @A;
my %B=();
$B{'fisrt'} = $first;
$B{'second'} = $second;
$B{'third = $third;

push (@A, \%B);
$A = \@A;
print "the scalar : ". scalar @$A . "\n";
$MySocket->send($A);

the scalar of @A = 1.

then on my server side, i receive values like this:
$MySocket->recv($A,128);

however, at this moment, the scalar of @A would be zero.
print scalar @$A;

is my coding incorrect? i think shall be no problem to send array via socket while it can be done in subroutine and module right?

please help!
Sponsored Links







Also available: Server administration forum archive | Web Design forum archive | Software forum archive | Hardware reviews archive

Copyright 2008 codecomments.com