object "loses values" when other object created

C

cisono

Hi,

Can anyone shed some light on this?!?!

I have created object 1 of class X. This object gets passed to a
method. At first, everything is OK.

However, as soon as I create another object (object 2) of class X (in
that same method):
- all the fields in object 1 "lose their values".
- object 1 still knows that it is an object of class X

Any idea why this would happen?

- Of course, the two objects have different variable names... (!)
- The class itself is declared in their own .pm file and it is properly
blessed (as far as I can tell).

cisono.
 
P

Paul Lalli

cisono said:
I have created object 1 of class X. This object gets passed to a
method. At first, everything is OK.

However, as soon as I create another object (object 2) of class X (in
that same method):
- all the fields in object 1 "lose their values".
- object 1 still knows that it is an object of class X

Any idea why this would happen?

Yes. You did something wrong.

However, since you provided absolutely no code for us to examine, it is
wholly impossible to determine *what* you did wrong. A completely
random *guess* is that your issue has to do with not properly scoping
the variables in your module.

Please read the posting guidelines for this group, and then follow the
adivce contained therein; specifically, post a short-but-complete
script that illustrates your problem.

Paul Lalli
 
P

Paul Lalli

cisono said:
No need to lecture.

Clearly, there is a need, as you still obviously haven't read the
posting guidelines and still haven't provided anyone with any
information that could help them help you.
Thanks anyway

You're quite welcome.

Paul Lalli
 
C

cisono

At the time, I could not post the whole script or easily reduce it to a
small number of lines that would still recreate the problem.

If you really want to remind people of the guidelines, you should
provide a link.
 
T

Tad McClellan

cisono said:
No need to lecture.


Just because you haven't seen the need does not mean that it does not exist.

People that persist in posting without context risk getting killfiled.

Listening to the lecture would have helped you to avoid such a fate.

Thanks anyway


But it didn't work.

So long!
 
P

Paul Lalli

cisono said:
At the time, I could not post the whole script or easily reduce it to a
small number of lines that would still recreate the problem.

If *you* couldn't put that tiny amount of effort into debugging your
problem, exactly how could you expect anyone else to be able to divine
both what you did wrong and how to fix it? You gave us *nothing* to
work with.
If you really want to remind people of the guidelines, you should
provide a link.

Yeah, definately. Because as you've already proven, you are far too
lazy to actually type the word "guidelines" into the Google Groups
search box. I know that you are far too lazy because you have again
shown your failure to read the guidelines, by continuing not to quote
any context in your replies.

I'm done trying to get you to help yourself. Fare well.

Paul Lalli
 
I

Ian Wilson

cisono said:
Actually, it did work.

If it (the lecture or your reading of it) had worked, surely neither
Paul nor Tad would have killfiled you and your reply might have looked
as follows instead:

-----------------------------------------------------------------------
Tad said:
cisono said:
Paul said:
cisono wrote:

[snip: vague description of a problem]

since you provided absolutely no code for us to examine,
it is wholly impossible to determine *what* you did wrong
Please read the posting guidelines for this group

No need to lecture

Listening to the lecture would have helped you <avoid being killfiled>
but it <the lecture> didn't work.

Actually, it did work.
 
A

A. Sinan Unur

At the time, I could not post the whole script or easily reduce it to
a small number of lines that would still recreate the problem.

If you really want to remind people of the guidelines, you should
provide a link.

I know this is old, but I'll take the bait anyway:

Locating the comp.lang.perl.misc guidelines is as simple as typing

comp.lang.perl.misc guidelines

in the Google search box.

If you are a newcomer, please note that, in general, no one will be
willing to put any effort into helping you if you have not put any
effort into helping others help you.

Just FYI.

Sinan
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,769
Messages
2,569,580
Members
45,054
Latest member
TrimKetoBoost

Latest Threads

Top