Re: bless function

2001-09-17 Thread _brian_d_foy
In article <[EMAIL PROTECTED]>, [EMAIL PROTECTED] (Baby Lakshmi) wrote: > I really dont understand the functionality and advantages of using bless. bless() "tags" a reference with a package name, effectively turning it into an object. without bless you don't have objects. http://www.perld

Re: bless function

2001-09-17 Thread Jeff 'japhy/Marillion' Pinyan
On Sep 17, baby lakshmi said: >should we have to use the bless fuction in the constructor alone we can >use the created object ($foo) to invoke the function. isnt it??? so whatz >the real advandage of using bless function??? and why we need to bless that >particular object to some specific

Re: bless function

2001-09-17 Thread baby lakshmi
Hello Jeff, Thank you for ur reply. > >package Animal; > >sub named { > > my $class = shift; > > my $name = shift; > > bless \$name, $class; > >} > >sub eat{ > > my $class = shift; > > $class = ref($class) || $class; > > my $food = shift; > > print "$class eats $food\n"; > >} > >

Re: bless function

2001-09-14 Thread Jeff 'japhy/Marillion' Pinyan
On Sep 14, baby lakshmi said: >package Animal; >sub named { > my $class = shift; > my $name = shift; > bless \$name, $class; >} >sub eat{ > my $class = shift; > $class = ref($class) || $class; > my $food = shift; > print "$class eats $food\n"; >} >In this program i dont understand