The 'unrecognised attribute' is 'NAME_uc', as indicated in the 'foreach' line of code (not 'pseudocode') included in my original message.
As it turns out, the reason for the error message is the table whose name is stored in the '$to' variable doesn't exist.
(A little more background info which I probably should have provided is the code is part of a function for copying data from a table in an Oracle database to its 'counterpart' table in an Access database. A new Access database I'm trying to get the code to work with doesn't have all the tables the perl code is expecting)