CGI/Perl Guide | Learning Center | Forums | Advertise | Login
Site Search: in

  Main Index MAIN
INDEX
Search Posts SEARCH
POSTS
Who's Online WHO'S
ONLINE
Log in LOG
IN

Home: Perl Programming Help: Win32 Programming Help:
Sockets problem

 



Knoxy
New User

May 3, 2002, 3:35 AM

Post #1 of 2 (3618 views)
Sockets problem Can't Post

Hi,

I need some help with a sockets problem. I have a string eg "123123hello" that I convert to 16 bit using the pack and unpack functions.

I add this to an array and send it over the wire ... okay.

But my problem is that I need to add a hex bit (0x00) before and after the packet and I don't know exactly how to do this. I've tried adding \x00 to the start and end of the array but it gets sent as the letter S.

Anyone help ???

thanks


fashimpaur
User

May 9, 2002, 9:38 AM

Post #2 of 2 (3601 views)
Re: [Knoxy] Sockets problem [In reply to] Can't Post

Knoxy,

We meet again.

Try taking your array, and redefine it something like this:

my @data = # pack/unpack magic you are doing...;

@data = (0x00, @data, 0x00);

Hope that helps.
Dennis

$a="c323745335d3221214b364d545".
"a362532582521254c3640504c3729".
"2f493759214b3635554c3040606a0",
print unpack"u*",pack "h*",$a,"\n\n";

 
 


Search for (options) Powered by Gossamer Forum v.1.2.0

Web Applications & Managed Hosting Powered by Gossamer Threads
Visit our Mailing List Archives