in reply to Re^2: what is @$varname in perl
in thread what is @$varname in perl
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:
$row @$row +---+ +-----+-----+-----+-- | *-----> | ... | ... | ... | ... +---+ +-----+-----+-----+--
and something like this for the entire file:
$sheet2 @$sheet2 (each of the @$row's) +---+ +---+ | | +-----+-----+-----+-- | *-----> | *-----> | ... | ... | ... | ... +---+ | | +-----+-----+-----+-- +---+ | | +-----+-----+-----+-- | *-----> | ... | ... | ... | ... | | +-----+-----+-----+-- +---+ | . | .
Does that make it clearer?
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^4: what is @$varname in perl
by sandy105 (Scribe) on Jul 03, 2014 at 10:59 UTC | |
by 2teez (Vicar) on Jul 03, 2014 at 11:11 UTC | |
by AppleFritter (Vicar) on Jul 03, 2014 at 11:13 UTC |