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

Re: Is this 'keys' Correct ?

Expand Messages
  • jonathansamuel@yahoo.com
    ... The following works fine for me. Perhaps you had a typo: use strict; my %lisp; my $isp = hello ; my $p; $lisp{$isp}=1; $lisp{9}=1; foreach my $i (keys
    Message 1 of 2 , Jul 31 9:08 AM
    • 0 Attachment
      --- In perl-beginner@y..., gordon stewart <gordonisnz@y...> wrote:

      >
      > Am i doing the foreach wrong ?
      >

      The following works fine for me. Perhaps you had a typo:

      use strict;
      my %lisp;
      my $isp = "hello";
      my $p;
      $lisp{$isp}=1;
      $lisp{9}=1;

      foreach my $i (keys %lisp){
      $p=($p+1);
      print "<BR>P = '$p' '$i'<BR>\n";
      }
    Your message has been successfully submitted and would be delivered to recipients shortly.