Perl MooseX::Singleton - seltsames Verhalten waehrend "global destruction"

Dieser Code
Code:
#!/usr/bin/perl

unshift @INC, '.';

require foo;
foo -> new;
Code:
package foo;

use MooseX::Singleton;

open my $stdin, '>&', *STDERR;

has foo => (
    is          => 'ro',
    isa         => 'Any',
    default     => sub { 1 },
);

sub DEMOLISH { shift -> foo };

1;
liefert bei mir diese Ausgabe:
Code:
Use of uninitialized value in concatenation (.) or string at /usr/local/lib/perl/5.10.1/Class/MOP/Package.pm line 102 during global destruction.
Use of uninitialized value in subroutine entry at /usr/local/lib/perl/5.10.1/Class/MOP/Class.pm line 526 during global destruction.


Das seltsame daran ist, dass die Zeile
Code:
open my $stdin, '>&', *STDERR;
daran schuld zu sein scheint.

Kommentiert man die Zeile aus, laeuft das Script ohne Fehler durch.
Gleiches gilt, wenn der Destruktor auskommentiert wird, oder in ihm auf kein Attribut zugegriffen wird


Hat jemand eine erklaerung fur mich, warum ich diese Fehlermeldungen erhalte?

- MfG, Keks


Code:
perl -v

This is perl, v5.10.1 (*) built for x86_64-linux-gnu-thread-multi

Copyright 1987-2009, 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.

Code:
Moose 0.93
MooseX::Singleton 0.22
 
Zuletzt bearbeitet:
Zurück
Oben