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

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

by ig (Vicar)
on May 22, 2013 at 23:32 UTC ( #1034829=note: print w/replies, xml ) Need Help??

Help for this page

Select Code to Download


  1. or download this
    use strict;
    use warnings;
    ...
    my @arr = unpack('(W W @0Wx/a @1W@0Wx/x/a)', "\005\006Hello World");
    
    print Dumper(\@arr);
    
  2. or download this
    $VAR1 = [
              5,
    ...
              'Hello',
              ' World'
            ];
    

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://1034829]
help
Chatterbox?
[Veltro]: Like I said before, I ment the solution as a whole
[Veltro]: People thought it was not possible.
[marto]: and until recently it wasn't and arguable (for some samples) probably isn't
[Veltro]: How did we get here? Oh yeah, advertisement. So let's get back there. What I ment to say is that I think it is possible to create an algorithm that filters out advertisement
[Veltro]: And yes, maybe your decoder needs the cloud to do so.
[marto]: for sane sources you should be able to do that locally

How do I use this? | Other CB clients
Other Users?
Others chilling in the Monastery: (8)
As of 2018-05-24 12:15 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    Notices?