in reply to Object oriented mess

Do you have strict and warnings enabled in all the files? You're probably overriding sub_in_abc() somewhere, and those pragma's should help you catch that sort of thing.

By the way, how do you know that sub_in_abc() "works fine when compiled individually"?

Replies are listed 'Best First'.
Re^2: Object oriented mess
by longliveAJ (Acolyte) on Apr 13, 2005 at 14:33 UTC
    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.
      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.

      -derby
        Internal server 500 error.

        I have just posted the code for Client.pm above...