I want to parse a large XML file and I have two options: Perl or PHP. Being new to both languages what would be your suggestion about language of choice for parsing a large XML file?
And what modules are more appropriate for the task at hand?
I want to parse a large XML file and I have two options: Perl or PHP. Being new to both languages what would be your suggestion about language of choice for parsing a large XML file?
And what modules are more appropriate for the task at hand?
PHP has a built in function called simplexml which makes it very easy to handle XML files.
Just off the cuff - I have no knowledge of the specific XML parsing capabilities of either language - I would say if it's parsing, go Perl. Perl's regular expression support is excellent and makes it the language of choice when there is parsing to be done. Your mileage may vary.
XML is usually parsed in one of two modes: stream or DOM. DOM is convenient, but unsuitable for large files. XML::Twig from CPAN has mixed mode, which has advantages of both modes.
Use the language that you are most comfortable with.
If you decide to use Perl, please refer back to the "parsing XML using Perl"-questions you asked recently: