Saladino has asked for the wisdom of the Perl Monks concerning the following question:
And I'm trying to unpack it in a single line, something like this:struct mystruct{ int id[10]; char text[40]; unsigned short int len;
But everything is going to the first array, i've tried templates as "N10 C40 n" and "(N10)(C40)(n)"my(@ids,$text,$length) = unpack("N10C40n",$buff) ;
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: unpack() to several variables
by Fletch (Bishop) on Jul 22, 2009 at 13:03 UTC | |
by psini (Deacon) on Jul 22, 2009 at 13:10 UTC | |
by Saladino (Beadle) on Jul 22, 2009 at 13:26 UTC | |
|
Re: unpack() to several variables
by jbt (Chaplain) on Jul 22, 2009 at 13:01 UTC | |
|
Re: unpack() to several variables
by Marshall (Canon) on Jul 22, 2009 at 13:20 UTC | |
by JavaFan (Canon) on Jul 22, 2009 at 13:23 UTC | |
by Saladino (Beadle) on Jul 22, 2009 at 13:22 UTC | |
by Marshall (Canon) on Jul 22, 2009 at 17:05 UTC |