Hackerboard WikiHaboBlog

[HaBo]

 
(Web-) Design und webbasierte Sprachen Tipps & Tricks, Designabgleich, HTML & Javascript, Flash, ASP, PHP, Perl/CGI...

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

Diskussion: MooseX::Singleton - seltsames Verhalten waehrend "global destruction" im Forum (Web-) Design und webbasierte Sprachen, in der Kategorie Web, Network & Multimedia Palace; Dieser Code Code: #!/usr/bin/perl unshift @INC, '.'; require foo; foo -> new; Code: package foo; use MooseX::Singleton; open my $stdin, ...

Antwort
Alt 02.01.10, 11:32   #1 (permalink)
 
Registriert seit: 06.01.07
keksinat0r Leistung: Facit NTK
Likes: 0
Standard 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


info   

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

Geändert von keksinat0r (02.01.10 um 11:35 Uhr)
keksinat0r ist offline   Mit Zitat antworten
Antwort
   

Werbung ist gerade online    

[HaBo] » Web, Network & Multimedia Palace » (Web-) Design und webbasierte Sprachen » Perl MooseX::Singleton - seltsames Verhalten waehrend "global destruction"
Themen-Optionen
Ansicht

Forumregeln
Es ist Ihnen nicht erlaubt, neue Themen zu verfassen.
Es ist Ihnen nicht erlaubt, auf Beiträge zu antworten.
Es ist Ihnen nicht erlaubt, Anhänge hochzuladen.
Es ist Ihnen nicht erlaubt, Ihre Beiträge zu bearbeiten.

BB-Code ist an.
Smileys sind an.
[IMG] Code ist an.
HTML-Code ist aus.
Trackbacks sind aus
Pingbacks sind aus
Refbacks sind aus



1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61