Re: use of bless

2016-02-28 Thread Kent Fredric
On 28 February 2016 at 21:59, rakesh sharma wrote: > According to docs bless returns the reference to self. That just means that if you do: my $x = {}; my $y = bless $x, "THING"; $y and $x will both be the same thing, a {} blessed into "Thing" Its just more convenient to utilize the second of

Re: use of bless

2016-02-28 Thread Shawn H Corey
On Sun, 28 Feb 2016 08:59:20 + rakesh sharma wrote: > > HI all > > I am using object oriented perl and saw return self as well as bless > being used According to docs bless returns the reference to self. Why > should we use both statements in the new method > > Sent from Mail

Re: use of bless

2016-02-28 Thread kiranmcs
Can you share the code? I believe the bless is returning the reference to self, which is captured in a variable with name self and that variable is returned from new method. Does that explains it? Thanks Kiran. On 28 Feb 2016 9:00 am, "rakesh sharma" wrote: > > > HI all > > > > I am using obje