Loading ...
Sorry, an error occurred while loading the content.

Re: [PBML] need help reading hashes of hashes

Expand Messages
  • merlyn@stonehenge.com
    ... Frank You wrote previously qw( ... ) is a quoted string, like ... . You can t Frank put comments inside either of them without it being
    Message 1 of 5 , Feb 27 7:30 AM
    • 0 Attachment
      >>>>> "Frank" == Frank Kleinburg (el Oso de Tejas) <fkleinbu@...> writes:

      >> my @primes = (
      >> 2, # the only even prime
      >> 3,
      >> 5,
      >> 7, # lucky
      >> 11, # lucky again!
      >> );

      Frank> You wrote previously "qw( ... ) is a quoted string, like ' ... '. You can't
      Frank> put comments inside either of them without it being significant."

      Frank> Ambiguous indeed, because to my simple mind, the "# the only even prime"
      Frank> certainly to me looks "inside a qw()".. But your code segment did run with
      Frank> out error..

      Ahh, I just caught this too, after it was quoted by someone else.

      There's no *qw* in there. It's just a simple list.

      Please learn that:

      ( ... )

      is different in many ways from:

      qw( ... )

      These are TWO DIFFERENT constructs. qw() is a "quoted word" list:

      qw(fred barney betty wilma dino)

      is the same as:

      ('fred', 'barney', 'betty', 'wilma', 'dino')

      without all the extra quotes and commas.

      Now go back and re-read what I said. You can't have comments
      inside qw(). You can *certainly* have them in insignificant places
      inside (), as well as commas (separating and trailing).

      --
      Randal L. Schwartz - Stonehenge Consulting Services, Inc. - +1 503 777 0095
      <merlyn@...> <URL:http://www.stonehenge.com/merlyn/>
      Perl/Unix/security consulting, Technical writing, Comedy, etc. etc.
      See PerlTraining.Stonehenge.com for onsite and open-enrollment Perl training!
    Your message has been successfully submitted and would be delivered to recipients shortly.