[Date Prev][Date Next][Thread Prev][Thread Next] [Search] [Date Index] [Thread Index]

[MacPerl-WebCGI] Putting hash values in an array and checking that with an foreach is not working!



Hi I have the following code snippet and it's not working properly.
It should check the if any of the hash keys (from a POST form) is empty
and then do the error routine.
But it's not, it doesn't do anything of the sort.
Is it possible to do this or is there another way besides using TEN if-statements.
I may be getting this totally wrong, pls. just give me some hints.
Yours sincerely
Jimmy Lantz


########## Snippet ###########
@checks = ('$in{\'kurskod\'}', '$in{\'pnr\'}', '$in{\'fnamn\'}',
'$in{\'enamn\'}', '$in{\'telnr\'}', '$in{\'padress\'}',
'$in{\'postnr\'}', '$in{\'ort\'}', '$in{\'studietyp\'}', '$in{\'tentaresultat\'}');

foreach $check (@checks)
{
if ($check eq '')
{
&do_error;
exit;
}
}

==== Want to unsubscribe from this list?
==== Send mail with body "unsubscribe" to macperl-webcgi-request@macperl.org