I’ve to read and parse HTML file and populate a data structure (in C++). I’m planning to do the parsing using perl (so I can use some other perl modules.). My requirement is this.
- Get the file from gui (C++ code)
- Pass it to perl.
- Parse file on perl side (perl script using some other perl modules), populate the C++ structure
- Continue working on C++ side with the populated structure.
I’m reading about extending and embedding perl, but unable to figure out the correct procedure. Any help would be greatly appreciated.
In your reading did you find perlembed in Perl’s documentation? That’s the definitive resource for learning how to embed Perl in a C/C++ program. The author of the document was one of the original mod_perl developers, I believe.
I don’t think that embedding Perl for a trivial task would be the easiest solution when compared to doing a system call to perl and parsing the result, but for more involved needs it’s certainly a solution.