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

Yossi Klein kleinyossi at yahoo.com
Sat Jul 17 22:49:45 PDT 2004


If you've added 'use strict' and fixed all typos and
find that you're still getting the same error, please
verify that you're running the same version of
Storable.pm on both the client and server.

Yossi


--- liat <rin_liat at netvision.net.il> wrote:
> 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) };
> 
> 
> _______________________________________________
> Perl mailing list
> Perl at perl.org.il
> http://perl.org.il/mailman/listinfo/perl
> 



		
__________________________________
Do you Yahoo!?
Vote for the stars of Yahoo!'s next ad campaign!
http://advision.webevents.yahoo.com/yahoo/votelifeengine/




More information about the Perl mailing list