If i simply not use
use Client;
the entire application works fine.
So I feel that there is something wrong with Client.pm. But I have been reading tutorials and sample scripts and moreove Client.pm just has two functions in it.
I spent several hours yesterday trying to figure out what i am missing here.
| [reply] |
Correct ... check out require.
Note that the file will not be included twice
under the same specified name.
Add into that mix that require happens at run-time, use
at compile and the notion that require pulls in the current namespace and voila - your subs are in your client namespace. (replace &sub_x with &Client::sub_x to see).
And that's why I try not to mix require with use. If I have
global functions -- then either create a base class and let your Client class inherit them or create a util class and let your Client class use them.
| [reply] |
So what is the error you're getting, and what is in Client.pm? My ESP is a little rusty today :-)
By the way, you're probably not overriding that subroutine because the use statement is run before the require()s.
I'd be surprised if use strict; and use warnings; wouldn't catch the error, though.
| [reply] |
Internal server 500 error.
I have just posted the code for Client.pm above...
| [reply] |