Do you know where your variables are? | |
PerlMonks |
comment on |
( [id://3333]=superdoc: print w/replies, xml ) | Need Help?? |
Your get_name and set_name functions have now become object methods. This means that the first parameter they receive is the object reference. You need to deal with that before looking for the parameters you expect. A quick fix would be to do something like this:
But you have a bunch of other problems. Your $name variable should become an entry in the object hash ($self->{name}) otherwise it will be shared between all instances of your object. Good places to learn about this stuff are the perlboot and perltoot manual pages and Damian Conway's most excellent book Object Oriented Perl. --<http://www.dave.org.uk>
"Perl makes the fun jobs fun In reply to Re: Trying to learn how to build a module
by davorg
|
|