# File My_B.pm package My_B; use strict; use warnings; use base 'Exporter'; our @EXPORT_OK = qw/ verify count_adj count_bfd tc_count /; our $COUNT_ADJ = 0; our $COUNT_BFD = 0; our $TC_COUNT = 1; sub verify { my $fh = shift; my ( $routes, $inet0_total, $inet0_active, $inet6_total, ) = ( 375000, 3436701, 498151, 115803, ); my $pass_count = 1; ... $TC_COUNT++; ... } sub count_adj { $COUNT_ADJ } sub count_bfd { $COUNT_BFD } sub tc_count { $TC_COUNT } 1; # File A (Let's assume this is package main). use strict; use warnings; use FindBin; use lib "$FindBin::Bin"; # For now we'll just assume My_B # is in the same path as File A. use My_B qw/ verify tc_count /; ... verify($fh, 'host', 'state', 'testname'); print tc_count(), "\n";