Read perl dumped data into C#

174 Views Asked by At

How to read Perl Dumped data in C#? I write a hash structure into a text file from Perl script. I need to read the hash structure in C#.

How do I do it?

Thanks :)

2

There are 2 best solutions below

0
On

There are number of ways to read the data in the text file. One such way would be...

string[] readText = File.ReadAllLines(path);
        foreach (string s in readText)
        {
            Console.WriteLine(s);
        }
0
On

Data::Dumper is a debugging tool, not a data storage/exchange tool. You could write a parser for its output in C, but that would be reinventing an wheel by making it an octagon.

Instead, use an existing data exchange format (such as JSON or YAML) for which there exists libraries in both languages.