On Dec 11, 2003, at 10:52 AM, Eric Walker wrote:
[..]Well, the problem is that this is just one section of a file the other sections actualy have different format.
[..]every know and then you get something like list( "one" "two").
[..]The data i am making up as I didn't think it was important. I figured the form is what was needed.
[..]Once I get the key value pairs it doesn't matter because I am going to read another file like this and compare the data to make sure nothing has changed between the two files.
p0: the 'data' that you made up, was good enough to get us some direction to start looking at solutions.
p1: You might ultimately want to look at a re-write of how those 'files' are being created, so that the sub-sequent post parsing is simpler. IF that is not an option - then you might want to see if the application that created the format has a library that can be 'ported' and hence build out a perl module of your own that would share it's parser structure.
p1.1 - either go with say an xml-ish model hence use the LibXml module for parsing
p1.2 - assume that the applications library is lib_fung_parser.so - then you want to get your hands on the header files and use h2xs to generate your Fung::Parser module
p2: The problem of multiple section readings from a file should lead you towards a simpler process where you have keys in the file that indicate which 'parser' to be using at which point you might want to look at a 'dispatcher'... where each 'function' knows how\ to return stuff related to what it knows how to read, and specifically how it's 'end of section' will tell it to stop parsing and go back.
ciao drieux
---
-- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] <http://learn.perl.org/> <http://learn.perl.org/first-response>