in reply to Re: Testing Hash Arrays
in thread Testing Hash Arrays

Not valid..might help if i give u the entire code this is where im at now.
#!/perl/bin/perl sub adduser{ print "\nI am in the adduser array now"; } #create the array my @data = ( { query => 'First Name',}, { query => 'Firt Name', }, { query => 'School', }, { query => 'Phone', }, { query => 'Position', }, { query => 'Role', }, ); while (1) { #greeting system("cls"); print "iT For Dominica User Database:\n", "Enter the Number then enter the value.\n"; #number the amt of items in list for (my $i = 0; $i < scalar @data; ++$i) { print "\t", $i + 1, ". ", $data[$i]{query}, ": ", $data[$i]{value} + || "", "\n"; } print "\t0. Done\n"; print "Type a number to choose to change: "; my $number = <STDIN>; chomp($number); if ($number > 6){ print "Type a number to choose to change: "; $number = <STDIN>; chomp($number); next; } elsif ($number == 0 || $number > 6) { last; } --$number; print "\n\nPlease enter your ", $data[$number]{query}, ": "; $data[$number]{value} = <STDIN>; chomp($data[$number]{value}); }; print "While statement"; #if the fields are not filled in do this while(scalar @data{value} eq "" || null){ &adduser;#goes back to asking for array members last; if(scalar @data{value} ne "" || null){ #if the Value +s are present Print 'em for ($c1 = 0; $c1 < scalar @data; ++$c1){ print $data{value} . "\n"; }#end of for(); };#end of if{}; }

Replies are listed 'Best First'.
Re^3: Testing Hash Arrays
by ikegami (Patriarch) on Jun 27, 2005 at 16:58 UTC
    Untested, but lots of stuff fixed. Changes marked with "!!!!"
      Thanx for the corrections and tips