My knowledge of perl is limited to running commands. I have managed to come up with a shell script to output the gav of a pom.xml, using xpath as follows:
xpath pom.xml '//project/artifactId/text()'
Can't locate XML/XPath.pm in @INC (@INC contains: /usr/lib/perl5/site_perl/5.14/x86_64-cygwin-threads /usr/lib/perl5/site_perl/5.14 /usr/lib/perl5/vendor_perl/5.14/x86_64-cygwin-threads /usr/lib/perl5/vendor_perl/5.14 /usr/lib/perl5/5.14/x86_64-cygwin-threads /usr/lib/perl5/5.14 .)
Going to read '/home/****/.cpan/Metadata'
Database was generated on Mon, 25 Aug 2014 00:41:02 GMT
Fetching with HTTP::Tiny:
HTTP::Tiny failed with an internal error: Could not connect to 'proxy:8080': IO::Socket::INET: Bad hostname 'proxy' at /usr/lib/perl5/5.14/HTTP/Tiny.pm line 139
Proxy authentication needed!
(Note: to permanently configure username and password run
o conf proxy_user your_username
o conf proxy_pass your_password
Username: C-c C-c
While the environment variable is used,
cpan first checks its configuration.
o conf http_proxy
o conf http_proxy ''
Don't forget to use
o conf commit to make the change permanent.