Hi, I am learning to write unit test in perl using by mocking subroutines. I have a subroutine which basically invokes connect subroutine belonging to Socket module. Based on reply back, I perform processing. Connection.pm

This however still calls the provided host address and tests. I wanted to mock the connect so that irrespective of address passed it should return true.

In general the scripts are not OO. All online material indicate I am supposed to create a Object for socket. If my understanding is correct, the mocked Socket object is never being used in my connect_test call. Can someone please help me out in understanding what correction should I be doing?