in reply to Reaped: Real Basic Perl OOP Problem
Why are you calling instance methods as class methods?
You create an instance, called $message_obj here:
my $message_obj = Message->new( $name, $subject, $message );
But then you call the name() method as a class method, passing the object instance as a parameter?
my $name2 = Message->name( $message_obj );
That should be
my $name2 = $message_obj->name();
That's not to say that it will fix your problem, as the two are notionally equivalent, but you should be letting Perl take care of passing the instance handle for you. Why have a dog and bark yourself?
|
|---|