use XML::Simple; use Data::Dumper; my $data; my $test_count; BEGIN { $data = XMLin("t/testdata.xml"); $test_count = scalar @{ $data->{e} }; }; use Test::More tests => 2 + $test_count; use ExtractMailTLD; use_ok('ExtractMailTLD'); is(ExtractMailTLD::get_tld('bla@blu.at'), 'at', 'Habe at bekommen'); print Dumper $data; foreach my $test (@{$data->{e}}) { is(ExtractMailTLD::get_tld($test->{m}), $test->{t}, sprintf("tld von [%s] ist [%s]", $test->{m}, $test->{t}) ); } ##printf "zahl der tests %s\n", scalar @{$data->{e}};