LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Programming (https://www.linuxquestions.org/questions/programming-9/)
-   -   Perl Parse .bin file (https://www.linuxquestions.org/questions/programming-9/perl-parse-bin-file-738177/)

acandria17 07-06-2009 05:54 PM

Perl Parse .bin file
 
Hello everyone!

I've got a problem trying to parse through a .bin file. Ive parsed through a txt file already but im having trouble with the .bin since i am unable to read it. Should i somehow convert the bin to ascii before i try anything? If you have any suggestions or thoughts, I am all ears. Thanks in advance!

chrism01 07-07-2009 12:52 AM

Depends on exactly what the .bin file represents. Normally on Linux its a self-extracting file; ie you give it exe perms and run it:

chmod u+x file.bin
./file.bin

You need to know what it really contains, what format its in. There may well be a pre-written Perl module that will help.

j-ray 07-07-2009 05:42 AM

if it contains binary data you should not convert that to ascii. As chrism01 said there is a module for binary parsing here
http://search.cpan.org/~audreyt/Pars...arse/Binary.pm
among others...


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