For Programmers: Free Programming Magazines  


Home > Archive > PERL Miscellaneous > August 2005 > object "loses values" when other object created









You are viewing an archived Text-only version of the thread. To view this thread in it's original format and/or if you want to reply to this thread please [click here]

 

Author object "loses values" when other object created
cisono

2005-07-29, 9:04 am

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.

Paul Lalli

2005-07-29, 9:04 am

cisono wrote:
> 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

cisono

2005-07-29, 9:04 am

No need to lecture.
Thanks anyway

Paul Lalli

2005-07-29, 9:04 am

cisono wrote:
> 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

cisono

2005-07-29, 5:03 pm

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.

Tad McClellan

2005-07-29, 5:03 pm

cisono <cisono@gmail.com> wrote:

> 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!


--
Tad McClellan SGML consulting
tadmc@augustmail.com Perl programming
Fort Worth, Texas
Paul Lalli

2005-07-29, 5:03 pm

cisono wrote:
> 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

cisono

2005-07-29, 5:03 pm

Actually, it did work.

Ian Wilson

2005-07-29, 5:03 pm

cisono wrote:
> 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 McClellan wrote:
> cisono wrote:
>
> Listening to the lecture would have helped you <avoid being killfiled>
> but it <the lecture> didn't work.


Actually, it did work.
-----------------------------------------------------------------------

It didn't work: you didn't learn how to use newsgroups effectively and
consequently you got killfiled by the people most able to help.
Tad McClellan

2005-07-29, 5:03 pm

cisono <cisono@gmail.com> wrote:

> Actually, it did work.



What did?


--
Tad McClellan SGML consulting
tadmc@augustmail.com Perl programming
Fort Worth, Texas
A. Sinan Unur

2005-08-26, 6:58 pm

"cisono" <cisono@gmail.com> wrote in
news:1122648186.948044.204210@g44g2000cwa.googlegroups.com:

> 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

--
A. Sinan Unur <1usa@llenroc.ude.invalid>
(reverse each component and remove .invalid for email address)

comp.lang.perl.misc guidelines on the WWW:
http://mail.augustmail.com/~tadmc/c...guidelines.html
Sponsored Links







Also available: Server administration forum archive | Web Design forum archive | Software forum archive | Hardware reviews archive

Copyright 2009 codecomments.com