in reply to Duplicated values in a For Loop

It looks to me like $sqlinfo is the result of a database query, probably of the $sth->selectall_arrayref variety, and that those results contain multiple rows for some users. Would it not be simpler to modify the SQL query to obtain one row per user?

I'm really reaching here, but assuming a well-normalized database the SQL query probably joins three tables, something like:

select p.number, p.user, p.first, p.lastn, t.tel, e.email from people p left join telephone t on t.number = p.number left join email e on e.number = p.number
If this is the case, you're getting multiple rows for users with multiple telephone numbers and/or email addresses.

Changing the SQL query to get distinct users would require some way to select only one each tel and email.

If I'm guessing correctly, and changing the query is feasable, I'd need the database type (Oracle, MSSQL, MySQL, etc.) and the table schemas to work out a suitable WHERE clause.