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

Use a hash.

my %data_for; # XXX bad name, but I don't know what you need foreach my $filename (@filenames) { next unless $filename =~ /^(.*)\.txt$/; $data_for{$1} = 'whatever you need to store'; }

Cheers,
Ovid

New address of my CGI Course.