I've tried to resolve this with other general perl lists and perl monks. 
 So as a last resort I am trying you guys (due to it being off topic - 
not because of your skills or anything).
If anyone here can tell me why this is not working I would be 
grateful...

Yes, its a session module, and no I dont want to use Apache::Session - 
It has to run on a plain old apache server (no mod perl)

Thanks much


-----Original Message-----
From:   Chmura, William B. 
Sent:   Friday, September 07, 2001 10:53 AM
To:     'perl-win32-users'
Subject:        Object Madness - Problem starting an object sometimes...


If someone can help me with this I would be indebted.

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.  It then defaults back to the sessionmamaher

Here is the code - the session.pm and sessionmanager.pm  and 
testsession.pl (Tests the session object) go into a sub dir called 
library:

Run testsessionmanager.pl to see the problem

In Sessionmanager.pm on line 75 it works fine
When I try the same thing from line 161 it does not work

    













Bill Chmura
Ensign-Bickford Industries, Inc.
Information Technologies Department



---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to