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
package Kreis::Prot; use strict; use warnings; use Carp 'croak'; sub TIESCALAR{ my $class = shift; my $ref = shift; bless \$ref, $class; } sub FETCH{ my $self = shift; return $$self; } sub STORE{ my $self = shift; croak "Das Attribut ist schreibgeschützt!"; } ######################################### package Kreis; use strict; use warnings; sub new{ my $class = shift; my $self = bless{pi => 3.14}, $class; tie $self->{pi}, 'Kreis::Prot', $self->{pi}; return $self; } sub umfang{ my $self = shift; my %gegeben = ( radius => 0, durchm => 0, @_); return $gegeben{radius} ? 2 * $self->{pi} * $gegeben{radius} : $self->{pi} * $gegeben{durchm}; } ######################################### package main; use strict; use warnings; my $k = Kreis->new; print $k->umfang(radius => 10); # Versuch ein schreibgeschütztes Attribut zu beschreiben $k->{pi} = 123; # Fehlermeldung
1
2
3
4
5
6
7
8
9
10
11
12
13
# readelf -s ./lib/5.36.1/i686-linux/auto/threads/threads.so | grep FUNC
5: 00000000 0 FUNC WEAK DEFAULT UND __cxa_finalize@GLIBC_2.1.3 (2)
8: 00000470 81 FUNC GLOBAL DEFAULT 11 boot_threads
10: 0000031c 0 FUNC GLOBAL DEFAULT 9 _init
11: 00000508 0 FUNC GLOBAL DEFAULT 12 _fini
28: 000003a0 0 FUNC LOCAL DEFAULT 11 __do_global_dtors_aux
31: 00000430 0 FUNC LOCAL DEFAULT 11 frame_dummy
36: 000004d0 0 FUNC LOCAL DEFAULT 11 __do_global_ctors_aux
41: 00000469 0 FUNC LOCAL DEFAULT 11 __i686.get_pc_thunk.bx
45: 00000508 0 FUNC GLOBAL DEFAULT 12 _fini
46: 00000470 81 FUNC GLOBAL DEFAULT 11 boot_threads
52: 00000000 0 FUNC WEAK DEFAULT UND __cxa_finalize@@GLIBC_2.1
53: 0000031c 0 FUNC GLOBAL DEFAULT 9 _init
2023-12-05T11:17:14 LinuxerUnter Linux gibt es readelf
1
2
3
4
5
6
7
8
9
You are in an elvish clearing with levelled ground and logs.
To the northeast there is the magic door.
WEAR RING
You wear the valuable golden ring.
READ DOOR
You examine the magic door.
The magic door warns of elves approaching.