in reply to How to create the varibles with the file names

See glob.
my @txt_files = glob('/data/*.txt');

Caution: Contents may have been coded under pressure.