The "uninitialized value" is because ->{acct_name} isn't defined, which you can see in your reply of the Dumper output ... so the question is why that first array element from getActiveUser() doesn't have all the data it should ... Maybe a reference issue where somewhere else in the program, between calls to this sort code, you actually modify $activeUserAccts[0] somewhere?
... Ah -- yes. Note that you have -variable=>\$activeUserAccts[0] in the $acct_frame->Optionmenu() call ... that's what's going to be destorying/overwriting in some way the first BPP::ACCOUNT hashref.


The other part, Can't set -options to `ARRAY(0x1d1d0dc)' ... might be caused by the first issue. do confirm, do this (the above error might be causing a malformed data structued; note thet Tk::Optionmenu wants something like -options => [[jan=>1], [feb=>2], [mar=>3], [apr=>4]]):
my $opts = [map {[$_->{acct_name}=>$_->{acct_id}]} @activeUserAccts]; print Dumper $opts; my $active_user_acct = $acct_frame->Optionmenu(-options=>$opts, -comma +nd=>sub {},-variable=>\$activeUserAccts[0], -width=>25 )->grid(-row=> +3, -column=>1,-sticky=>'nw');

In reply to Re: Uninitialized Value in Sort by davidrw
in thread Uninitialized Value in Sort by mikasue

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.