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; #### geedorah:~/perldtorbug# perl -MFoo -e 'package foo; bless ($self=[]) => __PACKAGE__; sub DESTROY {Foo->new()}' Foo xtor at Foo.pm line 12 during global destruction. foo att1 at Foo.pm line 22 during global destruction. lctest: lowercaseme! at Foo.pm line 23 during global destruction. lcfoo att1 at Foo.pm line 24 during global destruction. att1 - val1 at Foo.pm line 26 during global destruction. Fooxtor COMPLETE at Foo.pm line 29 during global destruction. Foo=HASH(0x81cea10) dtor at Foo.pm line 8 during global destruction. geedorah:~/perldtorbug# perl -MFoo -e 'package foo; bless ($self=[]) => __PACKAGE__;$f=Foo->new(); sub DESTROY {Foo->new()}' Foo xtor at Foo.pm line 12. foo att1 at Foo.pm line 22. lctest: lowercaseme! at Foo.pm line 23. lcfoo att1 at Foo.pm line 24. att1 - val1 at Foo.pm line 26. Fooxtor COMPLETE at Foo.pm line 29. Foo=HASH(0x817fa00) dtor at Foo.pm line 8 during global destruction. Foo xtor at Foo.pm line 12 during global destruction. foo att1 at Foo.pm line 22 during global destruction. lctest: lowercaseme! at Foo.pm line 23 during global destruction. Segmentation fault geedorah:~/perldtorbug# dmesg |tail -1 [1797167.620092] perl[9540]: segfault at 0 ip 081178d3 sp bfffdd90 error 4 in perl[8048000+131000] geedorah:~/perldtorbug# perl -v This is perl, v5.10.0 built for i486-linux-gnu-thread-multi Copyright 1987-2007, Larry Wall Perl may be copied only under the terms of either the Artistic License or the GNU General Public License, which may be found in the Perl 5 source kit. Complete documentation for Perl, including FAQ lists, should be found on this system using "man perl" or "perldoc perl". If you have access to the Internet, point your browser at http://www.perl.org/, the Perl Home Page. geedorah:~/perldtorbug#