If all what you want is to share data between scripts, Storable is also a candidator. The following scripts show that Storable handles the data type you have: (your data is frozen by an UDP client, sending to an UDP server, and the server thaw it, still get the same thing.)
Client: use Storable qw(freeze); use IO::Socket; use strict; use warnings; my $c = new IO::Socket::INET(Proto => "udp", PeerAddr => "localhost", PeerPort => 3000, Timeout => 1); print "Connected\n"; my $h = {"key" => [1,2,3,4,5,6,7,8,9,10]}; my $arr_freezed = freeze($h); $c->send($arr_freezed); close $c; Server: use IO::Socket; use Storable qw(thaw); use Data::Dumper; use strict; use warnings; my $server = new IO::Socket::INET(Timeout => 7200, Proto => "udp", LocalPort => 3000, LocalHost => "localhost"); print "Server is listening ...\n"; my $arr_freezed; $server->recv($arr_freezed, 1000); my $h = thaw($arr_freezed); print Dumper($h); close $server;
In reply to Re: SDBM_File and complex data structures
by pg
in thread SDBM_File and complex data structures
by muba
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |