Share your knowledge at the LQ Wiki.
Go Back > Forums > Non-*NIX Forums > Programming
User Name
Programming This forum is for all programming questions.
The question does not have to be directly related to Linux and any language is fair game.


  Search this Thread
Old 12-07-2005, 11:46 PM   #1
Registered: Oct 2004
Location: India
Distribution: Redhat
Posts: 88

Rep: Reputation: 15
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?
Old 12-08-2005, 05:27 PM   #2
Senior Member
Registered: Aug 2005
Posts: 1,755

Rep: Reputation: 49
Perhaps use unpack(). Read the perlpacktut for more information.


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off

Similar Threads
Thread Thread Starter Forum Replies Last Post
split command in perl not splitting / linuxmandrake Programming 1 11-03-2005 03:28 PM
Perl, integer and floats ivanatora Programming 2 04-06-2005 05:09 PM
Want to split a partition without data loss. Ebel Linux - Hardware 1 08-09-2004 11:56 PM
Perl Help (possible split) fooforon Programming 2 02-19-2004 05:53 AM
perl string split problem! farhanali Programming 4 06-22-2003 07:08 AM

All times are GMT -5. The time now is 11:01 PM.

Main Menu
Write for LQ is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration