ramkumar16 has asked for the wisdom of the Perl Monks concerning the following question:

PERL MODULE : To debug my perl module code in test environment. I have taken production module to the test in the my home path directory and was trying to test it by changing the below path in my test code. But still i am getting the error to debug it. can you please let me knw whether i am correct.
Code: Production Code : use strict; use banking::field; Test code : use strict use banking "/home/prod/banking/field"; use banking::field; Error getting below Use of qw(...) as parentheses is deprecated at banking/field.pm line 1 +493. Can't locate object method "new" via package "banking::field" (perhaps + you forgot to load "banking::field"?) at testout.pl line 42.

Replies are listed 'Best First'.
Re: perl module
by karlgoethebier (Abbot) on Feb 27, 2015 at 07:32 UTC

    I guess this should be:

    use lib q(/home/prod); use banking::field;

    You should also upcase your module names, like Banking::Field.

    Update: BTW, i would put it in /usr/local/lib/ or /home/ramkumar16/lib/ - or what ever your user name is.

    Regards, Karl

    «The Crux of the Biscuit is the Apostrophe»

Re: perl module
by Laurent_R (Canon) on Feb 27, 2015 at 07:40 UTC
    Try this:
    use lib 'path of the module'; use banking::field;
    Update : Karl was faster than me and he is right to point out that the admittied convention recommend your module name to be:
    use Banking::Field;
    and to change the directory and file names accordingly.

    Je suis Charlie.