On Fri, 2003-08-15 at 15:46, [EMAIL PROTECTED] wrote:
> you can avoid the hard-coding.
> 
> sub new
> {
>       my $class = shift;
> 
>       # blah de blah
> 
>       $class->gripe("charlie browns teacher");
> 
>       my $obj = \"magic beans here";
> 
>       return bless $obj,$class;
> }
> 
> 
> This would allow you to get around hard coding the class name.

Done, and thanks!

> 
> If it DOES need an object, I don't quite understand why
> you cant do the bless in new, call gripe, and just return
> the object when you're done.

Only because it felt odd and out of order to create the object before
it's attributes and such have been validated.

> sub new
> {
>       my $class = shift;
>       my [EMAIL PROTECTED];
>       bless $obj, $class;
> 
>       $obj->gripe("waaah wah whaa waaah");
> 
>       $obj->magic_bean_verification;
> 
>       return $obj;
> }
-- 
Sean Quinlan <[EMAIL PROTECTED]>

Attachment: signature.asc
Description: This is a digitally signed message part

_______________________________________________
Boston-pm mailing list
[EMAIL PROTECTED]
http://mail.pm.org/mailman/listinfo/boston-pm

Reply via email to