in reply to Comparing array contents to DB contents
foreach $row (@{$list}) { for(my ($i=0, $matched=0; $i<@vals; $i++) { if ( $vals[$i] && $row->[$i+1] && String::Approx::amatch($row->[$i+1], $vals[$i]) ) { $matched++; } else { last; } } return ($matched==@vals) ? $row->[0]; } # none found; do the insert, get the new id and return it
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Re: Comparing array contents to DB contents
by Gilimanjaro (Hermit) on Jan 30, 2003 at 10:38 UTC |