package Foo; use strict; use XML::LibXML; use Scalar::Util qw/weaken/; sub DESTROY { my $self=shift; warn "\n\n$self dtor"; } sub new() { warn "\n\n".__PACKAGE__." xtor"; my $self = {}; bless $self, __PACKAGE__; my $parser = new XML::LibXML(); my $confdoc = $parser->parse_string(''); my $root = $confdoc->documentElement(); my @nodes = $root->findnodes('/*'); for my $n (@nodes){ for my $att ($n->attributes()) { my $foo = $att->nodeName; warn "foo $foo"; warn "lctest: ".lc("LOWERCASEME!"); warn "lcfoo ".lc($foo); my ($key, $val) = (lc($att->nodeName), lc($att->getValue)); warn "$key - $val"; } } warn "\n".__PACKAGE__."xtor COMPLETE"; return $self; } 1;