hello Monks,

I have a problem at work that involves getting data from diary fields in a Remedy database. I'm using ARSPerl, which gets the data as an array of hashes. The ARSPerl documentation suggests a ways to get the data out of the hashes, but it doesn't work. I tried about 4 other things and they didn't work. One of these was from section 4.7.3 of Programming Perl.

I won't bore you with the details of every attempt. The last thing I tried looks like this:

my %hash = $diary_data[0]; my @temp1 = keys %hash; print "%hash\n"; foreach $temp2 (@temp1) { print "$temp2\n"; print "$hash{$temp2}\n"; }

This printed:

Reference found where even-sized list expected at ./send_referral.pl l +ine 200.<BR> Use of uninitialized value at ./send_referral.pl line 204.<BR> ARRAY(0x3c05dc)

(Line 200 starts with "my %hash" in the snippet above.

At this point, I'm wondering if there is a bug somewhere in this package? I have the same problem running this script on Solaris and on NT. I'm wondering about the error about an "even-sized list expected".

Thanks for the help.

Chumley

In reply to Getting information from an array of hashes by chumley

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.