LinuxQuestions.org
Help answer threads with 0 replies.
Home Forums Tutorials Articles Register
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-07-2005, 11:46 PM   #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, 05:27 PM   #2
spooon
Senior Member
 
Registered: Aug 2005
Posts: 1,755

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


Reply



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

LinuxQuestions.org > Forums > Non-*NIX Forums > Programming

All times are GMT -5. The time now is 05:18 PM.

Main Menu
Advertisement
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
Open Source Consulting | Domain Registration