in reply to sql entry of file name n size

First, take a look at opendir and readdir to eliminate that ls | tr | cut pipe. Then, please take the time to tell us what you tried and what problems you encountered. That helps us to help you better.

Maybe you want to interface to a database and store the information? Then DBI is what you need.