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"


In reply to Creating objects within objects being strange... by Vuud

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.