Thread Konstruktor (18 answers)
Opened by steffenw at 2005-08-02 12:16

Taulmarill
 2005-08-02 13:22
#56921 #56921
User since
2004-02-19
1750 Artikel
BenutzerIn

user image
[quote=steffenw,02.08.2005, 11:11]... das mit dem ref in
Code: (dl )
return bless {}, ref($_[0]) || $_[0];
ist also was anderes.[/quote]
das ist eine "abkürzung" für einen üblichen konstruktor. wobei die sache mit dem ref depreciated ist. eine etwas ausführlichere version ist:
Code: (dl )
1
2
3
4
5
6
sub new {
my $class = shift;
my $self = {};
bless $self, $class;
return $self;
}
$_=unpack"B*",~pack"H*",$_ and y&1|0& |#&&print"$_\n"for@.=qw BFA2F7C39139F45F78
0A28104594444504400 0A2F107D54447DE7800 0A2110453444450500 73CF1045138445F4800 0
F3EF2044E3D17DE 8A08A0451412411 F3CF207DF41C79E 820A20451412414 83E93C4513D17D2B

View full thread Konstruktor