perl.beginners
[Top] [All Lists]

Modifying StanzaFile

Subject: Modifying StanzaFile
From: Kashif Salman
Date: Fri, 14 Mar 2008 18:56:14 -0700
Newsgroups: perl.beginners

I have a config file with stanzas that I need to parse, going thorugh
CPAN I came across StanzaFile which works on stanzas like so

[name]
         variable=value
         variable1=value1
         ...
[name1]
         variableA=valueA
         variable1A=value1A

But my stanzas look like:

define name1{
    variable=value
    variable2=value2
..
}
define name2{
    variable=value
    variable2=value2
...
}

How can I modify the StanzaFile to work with my config file? or would
there be any other way to parse the file? Not only I have a different
stanza beginning but I also have an ending delimiter that doesn't
exist in the original format. I looked at StanzaFile::GRub which talks
a little about modifying StanzaFile but it doesn't make much sense to
me. Any ideas?

<Prev in Thread] Current Thread [Next in Thread>