in reply to DBI, s/// => unitinitialized value in substitution
I don't see where @rex is being initialized. Did you mean to use $row[] instead? That would certainly explain the uninitialized value warning.
Update: Actually, you're subtituting on $_, which isn't being set either. I think your code sample is incomplete!