in reply to (OT) What Was Your Most Bone-headed Programming Error?

If you're in a position to hire or recommend anyone, please do not read this :)

My worst blunder was something like this:

my $sth = $dbh->prepare(<<' END_SQL'); UPDATE product_people_currency SET people_id = ? WHERE people_id = ? END_SQL while (my ($old_id, $new_id) = each %id_pair) { $sth->execute($new_id,$old_id); }

Naturally, the new id happened to match several old ids and the program happily reupdated them. However, because all IDs were valid, all of the tests passed and we ran this snippet against a production database. Our clients saw that the web site was still up and informed us that the "update" worked fine. It was weeks of bad emails going to their product contacts before they realized that it was the web site that was messed up.

Cheers,
Ovid

New address of my CGI Course.