[Israel.pm] pack & unpack and system architecture

Natty aloha2004 at gmail.com
Sun Sep 4 08:34:13 PDT 2011


Hi,

I've packed a C structure which looks similar to:

struct  {
  unsigned char _vMapping1[3]; //  on the system perl is running, it sums up
to 3 bytes.
  unsigned char _vMapping2[3];   // on the system perl is running, it sums
up to 3 bytes.
  short _uPnP;  //  on the system perl is running, it sums up to 2 bytes.
}

I think there are some fill bytes, which there shouldn't be I believe, since
I am not getting what I'm expecting when using:

my $bin = unpack('c[3]c[3]s',...);

is there a module which will make my life easier to pack / unpack C
structures / binary data?

thanks,
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://mail.perl.org.il/pipermail/perl/attachments/20110904/ec3aa12b/attachment.htm 


More information about the Perl mailing list