Piers Cawley wrote: > > Eeeewwwwww. Most of the time I use 'my Dog $spot' is along the lines > of: > > my Dog $spot = Dog::Dalmation->new(name => 'Spot'); > $spot->bark; No problem, that still works, according to the RFC... > sub bark { > my Dog $self = shift; > print $self->name, " barks!\n"; > } Here I guess I miss the point of the Dog inside the bark() sub? It seems unnecessary to me. Maybe a better example of what you're trying to get at? > There's a whole host of occasions when you want 'my Dog $spot' but you > *don't* want $spot to be set to Dog->new. Well, I think the actual method name would be CREATE. So you could have either a new(), or a CREATE(), or both. Use whichever one you want, no sweat. The default core CREATE would simply instantiate a variable, which would then get set via Dog::Dalmation->new. -Nate
- Re: RFC 171 (v1) my Dog $spot should call a... Piers Cawley
- Re: RFC 171 (v1) my Dog $spot should call a constructor ... Hildo Biersma
- Re: RFC 171 (v1) my Dog $spot should call a constru... Matt Youell
- Re: RFC 171 (v1) my Dog $spot should call a con... Michael Fowler
- Re: RFC 171 (v1) my Dog $spot should call a con... Hildo Biersma
- Re: RFC 171 (v1) my Dog $spot should call a... Nathan Wiger
- Re: RFC 171 (v1) my Dog $spot should call a... Matt Youell
- Re: RFC 171 (v1) my Dog $spot should call a constru... Michael Fowler
- Re: RFC 171 (v1) my Dog $spot should call a constru... Nathan Wiger
- Re: RFC 171 (v1) my Dog $spot should call a constructor ... Piers Cawley
- Re: RFC 171 (v1) my Dog $spot should call a constru... Nathan Wiger
- Re: RFC 171 (v1) my Dog $spot should call a con... Piers Cawley
- Re: RFC 171 (v1) my Dog $spot should call a... Michael Fowler
- Re: RFC 171 (v1) my Dog $spot should ca... Piers Cawley
- Re: RFC 171 (v1) my Dog $spot shou... Michael Fowler
- Re: RFC 171 (v1) my Dog $spot ... Michael Fowler
- Re: RFC 171 (v1) my Dog $spot should ca... Damian Conway
- Re: RFC 171 (v1) my Dog $spot shou... Piers Cawley
- RE: RFC 171 (v1) my Dog $spot should call a constructor ... Evan Howarth
- Re: RFC 171 (v1) my Dog $spot should call a constructor ... Michael G Schwern
- Re: RFC 171 (v1) my Dog $spot should call a constru... James Mastros