in reply to The philosophy behind element reference syntax

One way to look at the array element is to consider other languages. If you want to access an array element, in most high level languages (C,Java) you would access it as foo[0]. Now, considering PERL's behavior, how do you want to access the memory block that contains foo[0], you want to access it as a scalar ($). This covers both simple arrays, as well as arrays that contain hashrefs and arrayrefs, as those are scalar references to memory locations.

That's how I got over that hump as a beginner, I hope that this could help.
amt.

perlcheat
  • Comment on Re: The philosophy behind element reference syntax

Replies are listed 'Best First'.
Re^2: The philosophy behind element reference syntax
by Anonymous Monk on Dec 08, 2004 at 17:03 UTC
    s/(P)(ERL)/$1\L$2\E/g;
      i don't get it, it looks like some sarcastic code reference regarding the proper spelling of Perl. ;)
      amt.

      perlcheat
        You said PERL in your first post, which is probably incorrect. I believe the annonymous monk was attempting to point this out.