LinuxQuestions.org
Did you know LQ has a Linux Hardware Compatibility List?
Go Back   LinuxQuestions.org > Forums > Non-*NIX Forums > Programming
User Name
Password
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.

Notices

Reply
 
Search this Thread
Old 12-08-2005, 12:46 AM   #1
ppanyam
Member
 
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, 06:27 PM   #2
spooon
Senior Member
 
Registered: Aug 2005
Posts: 1,755

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


Reply


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 04:28 PM
Perl, integer and floats ivanatora Programming 2 04-06-2005 06:09 PM
Want to split a partition without data loss. Ebel Linux - Hardware 1 08-10-2004 12:56 AM
Perl Help (possible split) fooforon Programming 2 02-19-2004 06:53 AM
perl string split problem! farhanali Programming 4 06-22-2003 08:08 AM


All times are GMT -5. The time now is 04:14 AM.

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