http://www.perlmonks.org?node_id=704567


in reply to Re^2: Sharing configuration information among test files
in thread Sharing configuration information among test files

You can put the duplicated code in a module (as you would in non-test code). Then your test scripts can look like:
use Test::More; use MyApp::Frob; use MyApp::Test::Config; my $cfg = MyApp::Test::Config->cfg; my $frob = MyApp::Frob->new($cfg->whoToFrob, $cfg->whatToFrob); ok($frob, "can create a frob");