thenarf has asked for the wisdom of the Perl Monks concerning the following question:

I'm trying to write some Perl code to deal with a set of GDBM data files that are maintained by Tolis Group's BRU, our backup software. While BRU seems to be quite bulletproof about the actual backup and restoration of data, the reporting features of the interfaces are somewhat lacking.

The database management parts of BRU appear to be written in Python and the data records appear to be Python tuples. A typical data file looks like this:

( 'string1', 'string 2', [ 1, 2, 3, 4 ], [ '/usr/bin', '/users' ], 'st +ring3' ] )
If I'm not mistaken, this is the way Python displays tuples. Is anyone aware of a Perl module or script out there that can read this sort of data, without having to write my own parser, or, worse, go off and learn Python to do this?

Thanks and regards,

John

Replies are listed 'Best First'.
Re: Reading Python-esque GDBM files easily?
by ikegami (Patriarch) on Mar 10, 2005 at 22:44 UTC
    That also valid Perl code, so you could simply do @list = eval $string;, if you trust the code. I'd prefer writting a parser, personally.
      I do in fact trust the code; I've examined the output from a test program, and this appears to do the trick!!!!

      Thanks very much!

      --John

Re: Reading Python-esque GDBM files easily?
by ambrus (Abbot) on Mar 10, 2005 at 22:50 UTC