J
Jeff Vacha
Hello All,
I am new to Perl and am really struggling to understand why the below
does not print an email address as I believe it should. When the
whole hash is displayed, the email address appears. However, when I
try to "look it up" in the hash, it doesn't appear. Any ideas what I
am doing wrong.
Thanks!
Jeff Vacha
(e-mail address removed)
# This is SybPerl code. If you don't no Sybperl, I think you can
still understand the question without understanding this part...
$dbh->ct_execute("select parm_name, parm_value from behavior_parms
where key=$key");
while($dbh->ct_results($restype) == SUCCEED) {
next unless $dbh->ct_fetchable($restype);
while (%dat = $dbh->ct_fetch()) {
$parms{$dat[0]} = $dat[1];
}
}
while(($TheKey, $TheVal) = each(%parms))
{print "$TheKey is the only key for $TheVal\n"}
$email_address = $parms{'email address'};
print "\nEmail: $email_address\n";
<<OUTPUT EXAMPLE:
email address is the only key for (e-mail address removed)
zip result is the only key for y
input table is the only key for map_cd
output file name is the only key for file_to_email.txt
Email:
Note.. the while loops works but the print of just the email address
doesn't.
I am new to Perl and am really struggling to understand why the below
does not print an email address as I believe it should. When the
whole hash is displayed, the email address appears. However, when I
try to "look it up" in the hash, it doesn't appear. Any ideas what I
am doing wrong.
Thanks!
Jeff Vacha
(e-mail address removed)
# This is SybPerl code. If you don't no Sybperl, I think you can
still understand the question without understanding this part...
$dbh->ct_execute("select parm_name, parm_value from behavior_parms
where key=$key");
while($dbh->ct_results($restype) == SUCCEED) {
next unless $dbh->ct_fetchable($restype);
while (%dat = $dbh->ct_fetch()) {
$parms{$dat[0]} = $dat[1];
}
}
while(($TheKey, $TheVal) = each(%parms))
{print "$TheKey is the only key for $TheVal\n"}
$email_address = $parms{'email address'};
print "\nEmail: $email_address\n";
<<OUTPUT EXAMPLE:
email address is the only key for (e-mail address removed)
zip result is the only key for y
input table is the only key for map_cd
output file name is the only key for file_to_email.txt
Email:
Note.. the while loops works but the print of just the email address
doesn't.