in reply to DBI, s/// => unitinitialized value in substitution

Where does @rex come from? Did you mean @row? Even if so, you're only selecting one value from the table, so $row[1] will always be uninitialized.

And always remember to use strict;