use Test_logger; my $log = Test_logger -> new(); #### $log -> message (" Start of program"); #### use ADDITION ( &test_addition); test_addition ( $log); sub test_addition { my $log = shift; $log -> message ("Inside the subroutine test_addition); } In my main program print $log ; gives HASH(0x1e2ec5c) in the subroutine print $log ; gives HASH(0x1e2ec5c)