Beefy Boxes and Bandwidth Generously Provided by pair Networks
laziness, impatience, and hubris

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?

What's my password?
Create A New User
Node Status?
node history
Node Type: perlquestion [id://1034810]
Approved by Paladin
Front-paged by davido
[perldigious]: A question since I'm ignorant of what's normal for database management... Do admins change column names a lot in databases?
[perldigious]: On occasion my scripts break, because they will do something that seems laregly pointless to me... like in this case, changing a column name from "ABC Category" to "ABC Category Override".
[perldigious]: Being the ignorant one, my initial reaction to that is, "that's sort of a dick move, a lot of people like me expect column names like that to stay the same, why the hell would you change them like that for seemingly no good reason?"
[perldigious]: Or is my irritation/ frustration well founded?

How do I use this? | Other CB clients
Other Users?
Others cooling their heels in the Monastery: (8)
As of 2017-05-25 13:29 GMT
Find Nodes?
    Voting Booth?