Hello, Im still working on learning perl and have run into something I dont under stand.
Below are 2 subs, 1 that enters data into a record, and 1 that shows all records.
with only 2 pices of data, like NAME and EMAIL, it all looks great, ONCE I add a 3rd peice of data, it still works but im getting a weird char printing out on the screen. I dont know what this is or where it is comming from. I have a feeling it has to do with this line of code
$currentValue = $CUSTLIST1{$name,$phonenum};
Im sure this is easy for most of you, but for a newbie, i have spent 2 days online, and down loaded some perl help books. Just cant get it.
sub enterData {
dbmopen (%CUSTLIST1, "database1", 0644) ||
die "Cannot open database.\n";
system('cls');
print "\n\tEnter your first and last name:\n\t";
$name = <STDIN>;
chomp($name);
print "\n\tEnter Email Address:\n\t";
$email = <STDIN>;
chomp($email);
print "\n\tEnter Phone number: \n\t";
$phonenum =<STDIN>;
chomp($phonenum);
$CUSTLIST1{$name, $phonenum} = $email;
$currentValue = $CUSTLIST1{$name,$phonenum};
print"\n\tEntry made: $currentValue\n\t";
dbmclose (CUSTLIST1);
system('cls');
next;
}
#---------------SHOW ALL RECORDS SUB
sub showAll{
dbmopen(%CUSTLIST1, "database1", 0666);
system('cls');
foreach $name(keys %CUSTLIST1){
$when = $CUSTLIST1{$name};
print "\n\t$name $when\n";
}
print "\n\tList complete. Press any key to continue.\n\t";
$answer = <STDIN>;
chomp($answer);
dbmclose(CUSTLIST1);
system('cls');
next;
}