Perl module error in testing


 
Thread Tools Search this Thread
Top Forums Shell Programming and Scripting Perl module error in testing
# 1  
Old 02-27-2015
Perl module error in testing

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 1493.
Can't locate object method "new" via package "banking::field" (perhaps you forgot to load "banking::field"?) at testout.pl line 42.

# 2  
Old 02-27-2015
You need to use require if you have to give full path of the module.

OR,
Code:
use lib qw(/home/prod/banking /home/prod/banking/field);
use banking::field;

# 3  
Old 02-27-2015
please confirm whether the below changes is correct.

Code:
use strict;
use lib qw(/home/prod/lib  /home/prod/lib/field);
use lib::field;

 
prod@500:/home/prod/lib> ls -ltr

  105144 Feb 27 07:22 field.pm

# 4  
Old 02-27-2015
I didn't ask to put the modules in a dir with name "lib".
You have to do exactly what I had mentioned.

Code:
use lib qw(/home/prod/banking /home/prod/banking/field);
use banking::field;


The above command expecting that you have banking.pm in "/home/prod/banking" dir and field.pm in "/home/prod/banking/field" dir.
# 5  
Old 02-27-2015
Code:
use strict;
use lib qw(/home/prod/banking/ /home/prod/banking/field);
use banking::field;

Still its not working.
Code:
Error :
Use of qw(...) as parentheses is deprecated at banking/field.pm line 1493.
Can't locate object method "new" via package "banking::field" (perhaps you forgot to load "banking::filed"?) at testoutputs.pl line 42.

---------- Post updated at 04:25 AM ---------- Previous update was at 02:42 AM ----------

any idea why it is not working when I placed the module in my home directories.

Last edited by ramkumar15; 02-27-2015 at 04:40 AM..
# 6  
Old 02-27-2015
Quote:
perhaps you forgot to load "banking::filed"?)
Check spelling of your module name.
# 7  
Old 02-27-2015
name is correct. I tried for another program still getting the same messge.
The below line I am getting in production as well so no probs.
Code:
Use of qw(...) as parentheses is deprecated at lib/mask.pm line 1493.

Can you please let me know why I am getting this
Code:
Can't locate object method "new" via package "lib::mask" (perhaps you forgot to load "lib::mask"?) at testout.pl line 40.

Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Perl SSH without a perl module

I'm trying to create a perl script that will do 1 SSH session, but be able to write multiple commands to the session and receive multiple outputs. I know there are modules out there like Net:SSH::Perl, but I'm not allowed to use it. I was thinking of doing something like an open3 on an ssh... (4 Replies)
Discussion started by: mrwatkin
4 Replies

2. Windows & DOS: Issues & Discussions

Strawberry perl - New TK module installation error

Hi, I am struggling in installing TK module for strawberry perl. I downloaded TK804 module, extracted to a folder, kept in c:/strawberry/perl/lib path, then from tht path 1) perl makefile.pl 2)dmake 3)dmake test 4)dmake install During perl makefile.pl it is giving error as... (3 Replies)
Discussion started by: vasanth.vadalur
3 Replies

3. Shell Programming and Scripting

calling perl subroutine from perl expect module

All, Is it possible to call a subroutine from the perl expect module after logging to a system that is within the same program. My situation is I need to run a logic inside a machine that I'm logging in using the expect module, the logic is also available in the same expect program. Thanks,... (5 Replies)
Discussion started by: arun_maffy
5 Replies

4. Shell Programming and Scripting

Which Perl Module to use?

Hi, I need to read an excel binary file and write the data to a text file. Is it possible using Spreadsheet-ParseExcel-0.58 ? If not, is there any module available in CPAN to do this? Thanks, Js (1 Reply)
Discussion started by: jisha
1 Replies

5. Shell Programming and Scripting

Perl - Error loading module.

Hi, I have a strange issue in my script. When script is run from command prompt it runs fine,but when run from cron it exist with error message. I narrowed down the issue and found that " use Mail::Sender;" is the culprit. If I comment the statment the code runs fine in both command and... (9 Replies)
Discussion started by: coolbhai
9 Replies

6. Shell Programming and Scripting

perl module error

Hi I am working on XMLDiff utility which is working only thing which is bug in this utility is that i used Excel file as the output file so that user can perform some operations on it ... now what i am doing is i am using Spreadsheet::Writeexcel module and its giving me problems ... flow... (0 Replies)
Discussion started by: zedex
0 Replies

7. Shell Programming and Scripting

Perl Module

Hi, Please help me!! Im wondering if anyone can help me with a problem i have with some perl modules. My problem is: I'm trying to connect remote host to a unix box from a windows machine. So i'm developing an application to do this. I'm programming it in perl with tcl/tk Gui interface.... (13 Replies)
Discussion started by: Phi01
13 Replies

8. Shell Programming and Scripting

Help with Perl Module

I dont know if this is a dumb question, but I am unable to move ahead and need help - There is a perl module called Header.pm which was written by someone else. I am trying to write a simple perl script which uses a function provided by the module. The function has been exported by the module... (9 Replies)
Discussion started by: NewDeb
9 Replies

9. UNIX and Linux Applications

help: error in installing perl module DBD::mysql

Hi, I am trying to install perl module DBD::mysql and don't know how to resolve the following: # make test PERL_DL_NONLAZY=1 /usr/bin/perl "-MExtUtils::Command::MM" "-e" "test_harness(0, 'blib/lib', 'blib/arch')" t/*.t t/00base.............ok 3/5install_driver(mysql) failed: Can't load... (3 Replies)
Discussion started by: Yogesh Sawant
3 Replies

10. Shell Programming and Scripting

Replace Perl Module name in all Perl scripts

I want to replace a Perl module name in all my Perl Scripts in the cgi-bin directory. How is it possible? I have the following statement in my scripts use myUtil; I want to change it to use myUtil777; Regards, Rahul (2 Replies)
Discussion started by: rahulrathod
2 Replies
Login or Register to Ask a Question