![]() |
|
good chemistry is complicated, and a little bit messy -LW |
|
PerlMonks |
Creating objects within objects being strange...by Vuud (Novice) |
on Sep 07, 2001 at 07:52 UTC ( [id://110823]=perlquestion: print w/replies, xml ) | Need Help?? |
Vuud has asked for the wisdom of the Perl Monks concerning the following question:
Larrys Name Be Praised... I am having a strange strange strange problem with my bunch of objects. I have TestScript that creates a SessionManager object. The SessionManager object, upon request creates a Session object. Keeps track of it and returns a sessionID upon success. When I tell the SessionManager object to create the new session I make a call like so: $retval = $sessionmanager->StartSession(); Inside the StartSession, if I do not pass a session ID, it creates a new session object. If I do a call to the Session package to make a new session object here like so: my $session = new Session(); It works fine, my new routine in Session gets called. If I change this so instead of making it here, it does a call like: $sessid = $self->MakeNewSession(); and move the exact same call to create the new session down into here it stops working. the "my $session = new Session();" does not give an error (warnings are on). But any calls to functions of that object such as: my $id = $session->SessionID(); Give me an error that says: Can't locate object method "SessionID" via package "main" at library/sessionmanager.pm line 155. If I call $session->{'objectneedssave'} I can use it as a hash. I also noticed that when I have warnings on, all of my bless statements give a warning that indicates my call to construct the object is not passing the class. Could this be related? HELP BEFORE I GO INSANE... "I'm never going to work another day in my life. The Gods told me to relax... I'm gonna be hooked up right"
Back to
Seekers of Perl Wisdom
|
|