I'm a perl Newbie and have been trying to send an array through a socket using udp. all of this data I need to send in binary (not ascii). and I've accomplished that,but I'm having problems sending an array through the send command. I'm obviously not sending it correctly, This is the line I'm having trouble with
send(SOCKET, @Cheese_Array ,0, $paddr); || die "send $host: $!";
My problem is I want to send all of the elements in one packet. ANd Sending it like above sends only one value out.
I can see that I can send it if access and send each element, but that also means I send one udp packet for each item.
SUch as:
foreach $item(@madArray) { send(SOCKET, pack("b8", $item) ,0, $paddr); # || die "send $host: $ +!"; }
Any help would be GREATLY appreciated! Thanks!
Edit - Petruchio Fri Sep 28 22:24:36 UTC 2001 - Added markup.
In reply to Sending an array through a socket! by flipxor
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |