LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Programming (https://www.linuxquestions.org/questions/programming-9/)
-   -   Perl: Binary data to be split into ints, shorts and floats (https://www.linuxquestions.org/questions/programming-9/perl-binary-data-to-be-split-into-ints-shorts-and-floats-390373/)

ppanyam 12-07-2005 11:46 PM

Perl: Binary data to be split into ints, shorts and floats
 
We have a binary data of 240 bytes read from a file. This data needs to be assigned to different variables in the following manner..
{ int, int, int, int, short, short, short, int ,int, float, float, short ......and so on}, a total of 240 bytes.

I have done it in C, C++ and Java, but I am unable to do it in Perl. Can any one help?

spooon 12-08-2005 05:27 PM

Perhaps use unpack(). Read the perlpacktut for more information.


All times are GMT -5. The time now is 07:41 PM.