in reply to Problem in perl/tk

SELECT * FROM university WHERE ID = $ID

A couple side points.

1) * should only be used in COUNT(*), EXISTS(SELECT * ...), and ad-hoc queries. Elsewhere, the column list ought to be specified. This is self-documenting and protects against column changes and reordering.

2) Please do not use dynamic SQL. It is insecure, and sometimes, not as efficient. It's easy to use a placeholder. Just replace $ID with a question mark (?) and pass the variable in the execute() statement. The foreach can still be used, just have it place question marks instead, and load an array to be used for the execute statement.