If I follow what you are asking, basically you are asking how to sort
through the keys of a hash, and see what the values are associated with
the keys in that hash. If this is correct, then this can be done very
simply:

foreach (keys %PLZ)
{
    print "$_ is checked\n" if $PLZ->{$_}->{Checked};
}

Inside the for, or foreach loops, the current variable is identified by
$_. When you are doing a foreach (keys) or foreach (sort keys) on a
hash, the $_ is the current key in the evaluation. You don't need to put
them into a list context in the intermediate like you are doing.

Does this work for you?

Steve H.

-----Original Message-----
From: [EMAIL PROTECTED]
[mailto:[EMAIL PROTECTED] On Behalf Of
YANDEX
Sent: Sunday, November 30, 2003 10:37 AM
To: perl-win32-gui-users@lists.sourceforge.net
Subject: [perl-win32-gui-users] not a CODE reference

Hello perl-win32-gui-users,

  I have a small window with many checkboxes. I need to ask every
  checkbox, so I:
  for(0..((keys %PLZ) - 1)){
      if($Window->(sort keys %PLZ)[$_]->Checked == 1){
      print $PLZ{(sort keys %PLZ)[$_]}." is checked\n";
  }

  this dont works, the error: "Not a CODE reference at ..."

  perldiag say to me: "(W overload) The second (fourth, sixth, ...)
  argument of overload::constant needs to be a code reference.
  Either an anonymous subroutine, or a reference to a subroutine."
  
  so I write workaround:

  for(0..((keys %PLZ) - 1)){
       $Ch = (sort keys %PLZ)[$_];
       if($ModalWindow->$Ch->Checked == 1){
       print $PLZ{(sort keys %PLZ)[$_]}." is checked\n";
  }

  can somebody tell me how can I do this without using intermediate
  variable ($Ch) ??
-- 
Best regards,
Pavel                         mailto:[EMAIL PROTECTED]



-------------------------------------------------------
This SF.net email is sponsored by: SF.net Giveback Program.
Does SourceForge.net help you be more productive?  Does it
help you create better code?  SHARE THE LOVE, and help us help
YOU!  Click Here: http://sourceforge.net/donate/
_______________________________________________
Perl-Win32-GUI-Users mailing list
Perl-Win32-GUI-Users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/perl-win32-gui-users


This message (including any attachments) contains confidential information
intended for a specific individual and purpose, and is protected by law. If
you are not the intended recipient, you should delete this message and are
hereby notified that any disclosure, copying, or distribution of this
message, or the taking of any action based on it, is strictly prohibited.


Reply via email to