in reply to Re^4: XML::Parser - Code Reference Error?
in thread XML::Parser - Code Reference Error?

I'm not sure that XML::Parser is what you need here, at least not for the task you're presenting. See an example of the usage of XML::Parser here.

Perhaps all you need is XML::Simple ?

#!/usr/local/bin/perl -w use warnings; use strict; use XML::Simple; use Data::Dumper; my $xs = new XML::Simple(KeepRoot => 1); my $address = "<LOC><HNO></HNO><STN>Eagle Way</STN><MCN>Gotham City</M +CN></LOC>"; my $ref = $xs->XMLin($address); print Dumper($ref); # to print "Eagle way" print $ref->{LOC}->{STN};