in reply to storing variable names in an array

It's possible to do that, but it's not really the easiest way.

Consider using a hash instead:

my %files = ( 'file1' => 'tom', 'file2' => 'bob', 'file3' => 'joe', ); $files{'file2'} = 'sam';
Alternately, just store your filenames in the array (if order is important), like:
my @names = ('tom','bob','joe'); $names[1] = 'sam';
Adding the additional step of the array of variable names is usally the wrong path to go down.

-- Kirby, WhitePages.com