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);
In reply to Module Creation and Function Call by girish_01
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |