4 Einträge, 1 Seite |
Quoteundefining copy:
undefined copy
configuring:
configured
destroying w:
destroyed w:
destroying Test=SCALAR(0x2c0d670)
Quoteundefining copy:
undefined copy
configuring:
destroying Test=SCALAR(0x2c0d670)
configured
destroying w:
destroyed w:
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
use Tk;
use strict;
use warnings;
use Scalar::Util qw/weaken isweak/;
use Devel::Peek qw/Dump/;;
package Test;
sub DESTROY {
print "destroying ",shift,"\n";
}
package Tk::MyWidget;
require Tk::Frame;
our @ISA = ('Tk::Frame');
Tk::Widget->Construct('MyWidget');
sub Populate{
my ($self,$args) = @_;
$self->SUPER::Populate($args);
$self->ConfigSpecs(-attr => ['PASSIVE',undef,undef,undef]);
}
package main;
my $ref;
{
my $val = 0;
$ref = \$val;
}
bless $ref ,'Test';
my $copy = $ref;
weaken $ref;
#Dump $ref;
my $mw = tkinit;
my $w = $mw->MyWidget(-attr => $ref,
)->pack;
$mw->update;
#Dump $ref;
print "undefining copy:\n";
undef $copy;
print "undefined copy\n";
print "configuring:\n";
$w->configure(-attr => 1);
$mw->update;
print "configured\n";
print "destroying w:\n";
$w->destroy;
$mw->update;
print "destroyed w:\n";
Quoteperl -MTk -e'print "$Tk::VERSION\n"'
804.0275
perl test3.pl
undefining copy:
undefined copy
configuring:
destroying Test=SCALAR(0x839866c)
configured
destroying w:
destroyed w:
4 Einträge, 1 Seite |