Think about Loose Coupling | |
PerlMonks |
Re^3: what is @$varname in perlby AppleFritter (Vicar) |
on Jul 03, 2014 at 10:38 UTC ( [id://1092140]=note: print w/replies, xml ) | Need Help?? |
I'm not entirely sure what your question is, or where the confusion lies. Could you clarify? As I said above, references are sort of like pointers in C, if you're familiar with that. A data structure lives somewhere in memory; another variable, a scalar (which might in turn be an element of an array or hash, of course) holds a reference to it. A redirect, if you will: "the data you're looking for is found in another location. Walk this way!" Programming Perl has an entire chapter on references, so if you've got that book, I'd read that. (If you don't have that book, buy it, it's a must-have for any Perl programmer.) Also, see perlref for a less gentle introduction. Anyhow, to sum it up:
So you have something like this for each line:
and something like this for the entire file:
Does that make it clearer?
In Section
Seekers of Perl Wisdom
|
|