Beefy Boxes and Bandwidth Generously Provided by pair Networks
Do you know where your variables are?
 
PerlMonks  

how to unpack a C struct with length array preceding data array

by johnlumby (Initiate)
on May 22, 2013 at 19:28 UTC ( [id://1034810]=perlquestion: print w/replies, xml ) Need Help??

Help for this page

Select Code to Download


  1. or download this
      {   
       short lengths[2];
    ...
      }
    where there are two items in data,  of length
    lengths[0] and lengths[1] respectively.
    
  2. or download this
    eval('($junk1 , $junk2, $data0, $data1) = unpack "ssA' . $data0_length
    + . "A" . $data1_length . '",$rcvd_buf;');
    

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: perlquestion [id://1034810]
Approved by Paladin
Front-paged by davido
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others romping around the Monastery: (5)
As of 2024-04-25 10:12 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found