in reply to Database files and PERL

First you need to be acquainted with DBI (search for it on CPAN). For UDB it is reasonable to equate the term file with table. So you want to count the tables in the database. The SQL command LIST TABLES will be understood by DB2, so you just have to prepare and execute the LIST TABLES statement and fetch the results into an array reference. If the array reference is saved to say $fred, then the perl expression "scalar @$fred" will return a count of the tables in the UDB. This is an overview, of course the real exercise is to understand a whole bunch of methods in the DBI class, documented in CPAN.

One world, one people