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

    thank you !!!! ..that cleared up my doubts.

    guess i bought the wrong book :learning perl -O'reilly.

    It does'nt have the topics which i have had problems with since starting with perl like map,threads,queue,reference :(

      ...guess i bought the wrong book :learning perl -O'reilly...

      Maybe not! Learning Perl is also a great book directed towards beginner in Perl. Maybe that is not the book you would have wanted since you have understanding in programming.
      You might then look at Beginning Perl by Ovid and Modern Perl by Chromatic. Am those will get you the lift you are looking for... :).

      Welcome to the realm of all possibilities, welcome to Perl Programming. Timtoday!!!

      Update:

      Let me also add that there is Intermediate Perl by the same Authors who wrote Learning Perl, that should be the one you wanted.

      If you tell me, I'll forget.
      If you show me, I'll remember.
      if you involve me, I'll understand.
      --- Author unknown to me

      Glad to have been able to help! *tips hat*

      And Learning Perl is a good book, really -- but it's not a complete reference (no pun intended) for the language.

      Re: Perl Documentation / Learning Projects has a list of useful books, BTW.