in reply to perl xml and array issue
As you’ll see for yourself when you read the tutorials, References are the “magic pixie dust” that lets Perl handle arbitrary data structures easily. A reference is “a single thing” (therefore, “that lives in one place,” much like a scalar...) that refers to something else. Vaguely like a C “pointer,” but infinitely more robust...
One of the key notions in Perl is that of contexts. If you refer to, say, an array-ref “in a scalar context,” you will see “a single thing” that looks like ARRAY(0..) or what-have-you. Or maybe you get “the number of elements in the array.” Your mileage may vary. But anyhow, when you use an array-ref “in an array context,” you get the array of values to which it refers. And this, basically, is what the notion of dereferencing is all about.
First, you say “Huh?” Then, you say “Oh, okay, now I get it ... Say, This Is Cool!!” And so it is.
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: perl xml and array issue
by ikegami (Patriarch) on Nov 18, 2010 at 22:06 UTC |