Quantcast
Viewing all articles
Browse latest Browse all 3

Answer by Quentin for XML::Smart Parser in Perl

The first thing you have done wrong is to comment out use strict, the second is to use -w instead of use warnings.

With strict turned on, perl will report:

Bareword "XML::Parser" not allowed while "strict subs" in use at tmp:test.pl line 19.

This lets us trace where the problem is occurring.

The examples in the documentation say that the second argument (the parser to use) should be quoted, and you haven't quoted it.

So we change to:

my $results = XML::Smart->new($esearch.$query,"XML::Parser");

… and it runs.

(Incidentally, the language is called "Perl", not "perl" or "PERL")


Viewing all articles
Browse latest Browse all 3

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>