girish_01 has asked for the wisdom of the Perl Monks concerning the following question:
I saved the file as iVPU_Parameter.pm and i am calling this module from a progam code:package iVPU_Parameter; require Exporter; @ISA=qw(Exporter); @EXPORT = qw(Configchk); sub Configchk() { &a=$_[0]; @arr_iVPU_standard=$_[1]; @arr_iVPU_current=$_[2]; blah blah blah }
It is able to call the module But when i try to print the array arguments in the Perl Module iVPU_Parameter.pm,byuse warnings; use iVPU_Parameter; $vlan_id=xxx; open(FH_CURRENT,"Running.txt"); open(FH_STANDARD,"Standard.txt"); @iVPU_current=<FH_CURRENT>; @iVPU_standard=<FH_STANDARD>; &Configchk($vlan_id,@arr_iVPU_standard,@arr_iVPU_current);
it does not print that ,but when i do the same in the calling program,it prints there so there is no problem in file handling.So i think the problem is in parameter passing or scope of the arguments. Also when i remove the ampersand (&) from the lineprint @arr_iVPU_standard;
it shows the error as Too Many arguments . Could you please help in this matter.&Configchk($vlan_id,@arr_iVPU_standard,@arr_iVPU_current);
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Module Creation and Function Call
by NetWallah (Canon) on Mar 19, 2012 at 18:04 UTC | |
|
Re: Module Creation and Function Call
by Riales (Hermit) on Mar 19, 2012 at 18:21 UTC | |
by girish_01 (Initiate) on Mar 20, 2012 at 06:11 UTC | |
|
Re: Module Creation and Function Call
by thargas (Deacon) on Mar 19, 2012 at 18:49 UTC | |
by educated_foo (Vicar) on Mar 20, 2012 at 12:56 UTC | |
by thargas (Deacon) on Mar 20, 2012 at 13:12 UTC |