[Israel.pm] does anyone understand why this code is not working?

liat rin_liat at netvision.net.il
Fri Jul 16 10:36:31 PDT 2004


hellow all,
I try to move a LIST from server to client and it is not working
i use the pack/unpack functions.
 i think i miss something and it's not working
i also tried to get the size of the list using the length functions and send
the "size" to the client and it's not working
The Error i get is:
"Magic number checking on storable string failed at ..\..\lib\Storable.pm
<autosplit into
..\..\lib\auto\Storable\thaw.al> line 358. at C:\liatperl\COPYOF~4.CGI
line 27"
and line 27 is on the client side:"my @urls_lines = @{
thaw($urls_serialized) }; "

if anyone knows this error plz let me know what's wrong..
thanks
 Liat



the server side:
   open(FILE,"url");
   my @urls_lines = <FILE>; # slurps all the file.
   my $urls_serialized = nfreeze(\@urls_lines);
   my $urls_lenght = pack('N', length($urls_serialized)); ## or my
$urls_lenght = pack('N', at urls_lines);
   send(client, $urls_lenght, 4);
   send(Client, $urls_serialized,length($urls_serialized),);

the client side:
    my $urls_lenght;
    my $urls_serialized;
    recv(SOCK, $urls_lenght,4,0)or die "recv() failed: $!";
    $urls_lenght = unpack ('N', $urls_lenght);
    recv(SOCK, $urls_serialized,$urls_lenght,0);
    my @urls_lines = @{ thaw($urls_serialized) };





More information about the Perl mailing list