more useful options | |
PerlMonks |
Serializing data using storable over socketby kernelzack (Novice) |
on Apr 11, 2011 at 23:20 UTC ( [id://898807]=perlquestion: print w/replies, xml ) | Need Help?? |
kernelzack has asked for the wisdom of the Perl Monks concerning the following question:
Hello all,
I am a beginner and am having some troubles over coming this issue. I have searched on the internet and have learned a lot in the process but have not been able to get past my roadblock. I am having trouble sending a hash across a tcp socket I have setup. I am using the IO::Socket module to setup the client and server. I am running my tests on 2 freebsd 8.1 x64 machines. Here is a snippet of what I am trying to do: #server code my %hash = ('tom' => 'brady', 'brett' => 'favre'); $send_data = nfreeze(\%hash); $client_socket->send($send_data); #client code $socket->recv($recv_data,1024); my $ref = thaw($recv_data); print $ref; When i try to just print in the client code I get nothing. No errors and no output. When I use this code in a simple test script it works as i expect. Here is my test code snippet not using sockets at all: #local script use Storable qw(nfreeze thaw); my $hash = {'tom' => 'brady', 'brett' => 'favre'}; print my $test = nfreeze($hash); print thaw($test); Can anyone point me in the right direction as to why I can't get this to work over a tcp socket? Thank you very much for your time. Sorry everyone, had to much to drink last night. I did not have $| set properly.... please disregard my stupidty. THanks
Back to
Seekers of Perl Wisdom
|
|