in reply to Things that make you go hmmm

The way that you are talking about "naming" the other array makes me think that you have just learned about symbolic references.

In which case allow me to help you take the next step by learning why symbolic references are unwise. (Read all three parts.) Then you can read up on strict.pm to find out how to avoid doing that by accident.

Which means that you do want to use references to anonymous arrays. Now that may seem like a mouthful, but here is all that it means. You can think of an anonymous array as a private array that you have been given a private name for. It will work for you exactly like naming other arrays did above, but because it is your private array, you don't have to worry as you do with symbolic references about things like accidentally reusing a name and getting a conflict, or accidentally using a name that is special to Perl.

In other words it is the same thing, only without the gotchas. :-)

  • Comment on Re (tilly) 1: Things that make you go hmmm

Replies are listed 'Best First'.
Re: Re (tilly) 1: Things that make you go hmmm
by mattg (Novice) on Nov 01, 2001 at 22:25 UTC
    Point well taken! And thanks for the quick heads-up. I try to avoid symbolic references in my code, but now I'll try a little bit harder. : )

    matt