Beefy Boxes and Bandwidth Generously Provided by pair Networks
Welcome to the Monastery
 
PerlMonks  

perl module

by ramkumar16 (Initiate)
on Feb 27, 2015 at 06:34 UTC ( [id://1118049]=perlquestion: print w/replies, xml ) Need Help??

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.

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: perlquestion [id://1118049]
Approved by Corion
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others learning in the Monastery: (3)
As of 2024-03-28 16:48 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found