in reply to Re^5: Declaring Hash entries
in thread Declaring Hash entries

Yeah i did try that, but recieved an error message about expecting $bytes. But never the less, the code i posted works great and pretty quick for what i want to do :)

Thanks for posting this tho, it will definitely show me a different approach to the same problem. Once i get back i will try to run the code above again to see why it wasnt working for me.

Thanks! EDIT: Yes, just read bytes, the index table will tell you where each infos are inside the file, all i did was predeclare read lengths, and then i use 0x0C to go to the actual data, then use the predefined read lengths. I will work on this more soon and post a follow up code (which should be alot shorter that my original code).

Replies are listed 'Best First'.
Re^7: Declaring Hash entries
by Anonymous Monk on Jan 05, 2015 at 22:13 UTC

    Yeah i did try that, but recieved an error message about expecting $bytes.

    Well, you won't get that with the files you posted :) which are small enough to post on perlmonks with Data::Dump::dd() )

    But croaking is there to help; for some reason program couldn't read from the file (past the end?) , so program might as well stop instead of making stuff up and generating a bunch of warnings

      Thats the thing, it has to work for every format file like this, not just the one i posted, that was just a sample of the thousands that are out there. There will be many many others, and if you check the download below you will see a now working file, which is the exact same byte for byte as the non working file in the download link above. I am going to update this code soon to not even use a hash. All the information to parse the file is in the index table
        What? My program works for all the files you posted, it follows the documented format ... it should work for every file that follows the format ... if it doesn't the files are corrupt (not following format) or your harddisk is dying