Rachel
Rachel

Reputation: 103477

Should I use Perl or PHP for parsing a large XML file?

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?

Upvotes: 1

Views: 929

Answers (4)

Alexandr Ciornii
Alexandr Ciornii

Reputation: 7392

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.

Upvotes: 4

Daniel Bingham
Daniel Bingham

Reputation: 12914

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.

Upvotes: 0

mrpatg
mrpatg

Reputation: 10117

PHP has a built in function called simplexml which makes it very easy to handle XML files.

Upvotes: 1

Related Questions