Anonymous Monk has asked for the wisdom of the Perl Monks concerning the following question:
Ok, what I don't want people to be able to choose the same name twice or three times, or so on. So is there a quick way to compare all the names, see if any are equal, and return an error? I am still learning Perl, so the only way I know how to do this is like so@names = ($INPUT{'name1'},$INPUT{'name2'},$INPUT{'name3'}, $INPUT{'name4'},$INPUT{'name5'});
But this method would take up a lot of space by making each comparison one at a time... so is there an easier way??? Thanks in advance if you can help me :)if ($INPUT{'name1'} eq $INPUT{'name2'}) { $error = 'duplicate vote'; &error; }
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
You're using CGI.pm, Right?
by chromatic (Archbishop) on Jan 23, 2000 at 05:02 UTC | |
|
Re: Question about comparing data values..
by vroom (His Eminence) on Jan 20, 2000 at 23:07 UTC | |
|
Re: Question about comparing data values..
by dlc (Acolyte) on Jan 25, 2000 at 00:32 UTC | |
|
Re: Question about comparing data values..
by Anonymous Monk on Jan 24, 2000 at 16:54 UTC |