[SLUG] Perl Discussion

From: mark@bish.net
Date: Thu Feb 24 2005 - 08:30:47 EST


Ok, here is a new one for you perl people out there.

I have it working, I'd just like to know if I did it the long way.

I have a 32 byte UDP packet I have to send out which seems pretty easy but
the protocol is binary, not ASCII (not my fault).

#there are 64 digits in the string below
my $msg1="0000000002150000000000000000000000000000000000000000000000000000";

I can also do $msg1="$byte1_hn.$byte1_ln.$byte2_hn.$byte2_ln..... (_hn is
High Nibble and _ln is Lower Nibble)

my $msg=pack("H64", $msg1);
$MySocket->send($msg);

Is this the most convoluted way or am I smart guy? Also, every byte can
be modified by a GUI with checkboxes and the like, so I am not going to be
typing this out everytime.
-----------------------------------------------------------------------
This list is provided as an unmoderated internet service by Networked
Knowledge Systems (NKS). Views and opinions expressed in messages
posted are those of the author and do not necessarily reflect the
official policy or position of NKS or any of its employees.



This archive was generated by hypermail 2.1.3 : Fri Aug 01 2014 - 19:34:14 EDT