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

Re: [PBML] Newbie question re: XML::Simple - Size of an array of hashes

Expand Messages
  • Bill Walton
    Hi Randal; That works!!! ;-) Thank you *very* much. I thought I d tried everything before I wrote. Obviously I didn t ;-(. I know I tried the @, but I m
    Message 1 of 3 , Nov 30, 2005
    • 0 Attachment
      Hi Randal;

      That works!!! ;-) Thank you *very* much.

      I thought I'd tried everything before I wrote. Obviously I didn't ;-(. I
      know I tried the @, but I'm guessing I had it outside parentheses instead of
      brackets. More reading on references coming up.

      Thanks for the doc references, too. Is there an easy way to search them?
      I've been using the html doc that comes with the install.

      Best regards,
      Bill

      ----- Original Message -----
      From: "Randal L. Schwartz" <merlyn@...>
      To: "Bill Walton" <bill.walton@...>
      Cc: <perl-beginner@yahoogroups.com>
      Sent: Wednesday, November 30, 2005 10:16 AM
      Subject: Re: [PBML] Newbie question re: XML::Simple - Size of an array of
      hashes


      > >>>>> "Bill" == Bill Walton <bill.walton@...> writes:
      >
      > Bill> #################################
      > Bill> # This attempt to get the size of the array
      > Bill> # doesn't work.
      > Bill> #################################
      > Bill> $ArraySize = scalar ($ref->{location});
      > Bill> print "ArraySize is: $ArraySize\n";
      > Bill> # prints 'ArraySize is: ARRAY(0x1d04780)'
      >
      > Close. You need to de-reference the array ref:
      >
      > my $size = @{$ref->{location}};
      >
      > Details are in "perldoc perlref" and "perldoc perlreftut".
      >
      > --
      > 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.