hi,
I'm trying to exclude some vars from a form collection when processing and decided i'd create an exclusion hash and then use the exists operator to evaluate.
Only it doesn't seem to be working, what am i doing wrong?
All the fields in the table collection get printed, so the exists isn't matching anything?
thanks
1DMF
"In complete darkness we are all the same, only our knowledge and wisdom separates us, don't let your eyes deceive you."
"If a shortcut was meant to be easy, it wouldn't be a shortcut, it would be the way!
I'm trying to exclude some vars from a form collection when processing and decided i'd create an exclusion hash and then use the exists operator to evaluate.
Only it doesn't seem to be working, what am i doing wrong?
Code:
#set exclude variables
my %excl = {issuedate=>1,memno=>1,recid=>1,periodstart=>1,status=>1,periodend=>1,compdate=>1};
#set date
my @ukdate = &uk_date;
my $comp = &yank_it($ukdate[0]);
my $val = "Comp_Date ='$comp',Status='COMP'";
#get table vars
my @rs = &getSQL("mytable","*","Rec_ID=" . $cgi->param('ID'));
#get form vars
my %vars = $cgi->Vars();
print "Content-type: text/html\n\n";
#loop and set SQL string
foreach my $key (keys %{$rs[0]}){
my $fld = lc($key);
$fld =~ s/\_//g;
[b]if(!exists $excl{$fld}){[/b]
print "$fld <br>";
}
}
All the fields in the table collection get printed, so the exists isn't matching anything?
thanks
1DMF
"In complete darkness we are all the same, only our knowledge and wisdom separates us, don't let your eyes deceive you."
"If a shortcut was meant to be easy, it wouldn't be a shortcut, it would be the way!