in reply to confusion about blessing inside a constructor

Take a look at perlobj. Read it through, then seek (0), and read it again.

A key is to understand that the constructor takes a reference to something, normally a hash or array, and blesses it.

An important aspect of a blessed object is that when you call a member on it $obj->member ($params) a reference to the object is unshifted into @_ - that is, the first parameter that member gets is $self (== this for C++ people). You have to do a little more leg work than you did in C++: if you need to access your "member data" you have to retreive "this" from the parameter list.

Now go back and read that documentation again. In the simple case it is simple I assure you. :)


DWIM is Perl's answer to Gödel