http://qs321.pair.com?node_id=1168156

KeighleHawk has asked for the wisdom of the Perl Monks concerning the following question:

So I've done a bad thing (TM) I am certain. I wanted to easiliy create a slew of "data files" from exisiting code that could be read back in and executed and later allow us to add many, many more test files. So I opted to use Data::Dumper to create the initial files, fixed them up a bit, then used the following to set the needed values for each test:

{ no strict 'vars'; local $/; my $in; open $in, '<', $test_env or die "..."; my $rc = eval <$in>; close $in; # set various values from that data structure. };

The above is essentially in a loop, reading in each test data file.

Besides the obvious of redesigning the data files as XML or some other, is there anyway to accomplish the above in a way that perlcritic is happy with? I have a bazillion test_xxx.pl files I'd rather not recreate at the moment.