in reply to Perl semi-object without a constructor
As far as I can see 'connect' *is* the constructor.
Whenever you see a construct that looks like Module->subroutine you should think "Class Method". The subroutine will be called with the Class name as the 1st parameter, and as expected it's used in a bless command.
Now that $conn is an object, all subroutines in it's class' (Msg) namespace and in the namespaces listed in Msg::ISA, can now be used as methods. Any such method will receive the blessed reference $conn implicitly as it's 1st parameter.
|
---|
Replies are listed 'Best First'. | |
---|---|
Re^2: Perl semi-object without a constructor
by Wiggins (Hermit) on Feb 20, 2013 at 20:14 UTC | |
by dsheroh (Monsignor) on Feb 21, 2013 at 09:43 UTC |
In Section
Seekers of Perl Wisdom