in reply to cgi programming problem with perl

Just a quick point about style:
$cgi-> p("$name $surename $phone already exists.\nGo back and +fill something else than that!").
would indicate that you're using global variables.

It would be much better if you didn't use variables declared outside your sub, but instead passed them in as parameters (the technical term is 'coupling', iirc) - it makes for better long-term maintainability.

rdfield