EchoAngel has asked for the wisdom of the Perl Monks concerning the following question:
The thing is I don't know how many sub division of {} there are inside the file (ie more subdivision within conditions. So I was thinking of a recursive function to do this. In the end, I want a hash to be created like this Ie call Data:Dumperlibrary(ABC) { date : 04/10/04; revision : 1.5; conditions () { weather : bright ; temperature : 55 C; visible : heavy \ fog; } location(work); etc ... }
I wrote some scrap code somewhere but I like to know what you guys think about my idea (good/bad) and where I could have some improvements.library(ABC) -> date -> value -> 04/10/04 -> revision -> value -> 1.5 -> conditions -> weather -> value -> bright -> temperature -> value -> 55 -> visible -> value -> heavy fog -> location(work) -> value -> 1
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Recursive Function To Parse File For Generating Hash
by NetWallah (Canon) on Nov 05, 2004 at 05:58 UTC | |
|
Re: Recursive Function To Parse File For Generating Hash
by saintmike (Vicar) on Nov 05, 2004 at 08:16 UTC | |
by dimar (Curate) on Nov 05, 2004 at 21:05 UTC | |
|
Re: Recursive Function To Parse File For Generating Hash
by tachyon (Chancellor) on Nov 05, 2004 at 08:37 UTC | |
|
Re: Recursive Function To Parse File For Generating Hash
by gaal (Parson) on Nov 05, 2004 at 08:09 UTC |