On May 28, 6:14 pm, [EMAIL PROTECTED] (Paul Lalli) wrote: > > > oh yes, more important than all that minutiae... the push did not > > work for me in the working code. > > The push worked absolutely fine. It just didn't do what you wanted it > to. Learning how to parse your problem should be your first step > toward becoming a better programmer. >
hmmm, misunderstanding there. The push worked fine in the sample I posted, but not in the more complex working program I had simplified as an example. > > The array was being rewritten. > > Then you didn't delcare your variables in the correct scope. understandable misperception on your part, as above > ...As a > general rule of thumb, declare your variables in the smallest scope > possible. > yes, sounds good. Please realize that after many long commercial projects in C/C++, we did this to an enormous degree > > I had to use an array copy > > > push @tRespsA, [ @r1 ]; ## copy contents to an anonymous array, > > push array ref > > Do you understand *why* that was necessary? Do you understand the > difference between these two pieces of code? > actually, I do indeed. In C++, the concept of a deep copy, vs shallow copy vs ref comes up all the time. I am just learning the syntax here, not programming itself > #Sample 1 > ... hey, thats alot of sample! you're good at this, no kidding driven too > > Do you see now? ... yep, never did miss that. thanks though... > ...By declaring only one instance of @array1... this is helpful to others to talk this out I'd say this can never be explained too much. Its slippery and a constant source of error. > > Paul Lalli aha, a force to be reckoned with. Your point above about the docs is quite true. I dont have time to rewrite docs right now.. They do need work though This is sometimes appearing to be contentious, but I mean it to produce clarity. I appreciate your responses -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] http://learn.perl.org/
