Beefy Boxes and Bandwidth Generously Provided by pair Networks
Perl-Sensitive Sunglasses
 
PerlMonks  

Re: Send/receive array through IO::Socket?

by isotope (Deacon)
on Dec 01, 2005 at 20:38 UTC ( [id://513427]=note: print w/replies, xml ) Need Help??


in reply to Send/receive array through IO::Socket?

Your big picture problem is that you need to serialize your data before passing it along -- sockets know only a series of bits, not data structures. As suggested before, YAML is an excellent choice for most uses. Perhaps the more traditional method is Storable, but there are plenty of choices available.


--isotope
  • Comment on Re: Send/receive array through IO::Socket?

Replies are listed 'Best First'.
Re^2: Send/receive array through IO::Socket?
by wolfger (Deacon) on Dec 01, 2005 at 20:42 UTC
    sockets know only a series of bits, not data structures.

    Okay. That validates my conclusion. Thanks! Unfortunately, Storable suffers the same inconvenience as YAML. At least I'm on the right track now.

      Not quite. Storable suffers completely different inconveniences from YAML. Storable can get tripped up if the levels of Storable on client and server aren't compatable. You have to be a bit careful if the endianness of the client and server are different (I think there's an "nstore" and "nthaw" for network-order storing) - assuming the levels of Storable are otherwise compatable.

      But it is part of the core, so it's already installed. That inconvenience is unique to YAML. (Well, unique in the context of YAML vs Storable.)

      Storable has been a standard module for quite a while.

      Phil

        It's not part of our core...

        CS/AIX i2mptpr3 $ perl -v

        This is perl, v5.6.0 built for aix
        ...

        CS/AIX i2mptpr3 $ perl -e 'use Storable;'
        Can't locate Storable.pm in @INC
        ...

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://513427]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others browsing the Monastery: (5)
As of 2024-04-19 03:06 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found