Beefy Boxes and Bandwidth Generously Provided by pair Networks
We don't bite newbies here... much
 
PerlMonks  

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

by johnlumby (Initiate)
on May 22, 2013 at 19:28 UTC ( #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
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? | Other CB clients
Other Users?
Others scrutinizing the Monastery: (9)
As of 2015-07-07 11:06 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    The top three priorities of my open tasks are (in descending order of likelihood to be worked on) ...









    Results (88 votes), past polls