One problem with this code is if you're adding a name that is the
prefix of a name already in the DB it will think that it is alrady there.
Try running this code and adding
les after
leslie has
already been added. Better to use
eq instead of
a regular expression in your compare since you are looking
for an exact match. It will be faster too:
if ($_ eq $name) {
instead of
if (/^$name/) {