|XP is just a number|
Re: Bin\Hex Parsing in Perl ?by jeroenes (Priest)
|on Oct 25, 2001 at 09:46 UTC||Need Help??|
Other monks learned me how to doo this some while ago. A bit confused though whether you are trying to read/write binary or a text file populated with hexidecimal characters.
For reading you could also use this to fetch fixed-length records:
With unpack you can translate both binary and hexidecimal data:
So the exact name of what you are trying to do? Reading binary files, unpacking ....
I will have a look into that Data:Hexdump module. It's probably worth it.
Mehopes it's all a bit clearer to you now.
Update: I've read the HexDump docs, and what it does is just to make a binary file ready for human reading like in a hex viewer. So it's very usable to dump a bin file on a tty, but not fit to parse a binary file for subsequent use in a script. See the code above.