I am trying to pass two different arrays to subroutine in same file. First array @act_table is two dimentional array and another is simple array (@colm)
Below is my code :for ($h=1; $h<=$arg[1]; $h++) { my @colm; for ($t=1;$t<=$arg[2];$t++) { push @colm, $act_table[$t][$h]; } Column(@act_table,@colm); } for ($i=1; $i<=$arg[2]; $i++) { for ($n=1;$n<=$arg[1];$n++) { #print" $table_arr[$i][$n]"; } } sub Column { no warnings; my @actcol=@_; my @col=@_; $colno++; print "In column : $colno\n"; foreach $_ (@col) { print "$_\n "; $_=~s/(<Tc(?:\s?\;?\s?\;?\d?)?>)(.*)/Entity_convert($2)/eg; $_= ThinSpace($_); #print "***************** $_\n"; } }
When i print @col trough foreach loop i get garbage values first and then actual values
This is really urgent. Can anybody please tell me what going wrong in my code?
Thanks in advanceIn reply to Passing two arrays to a subroutine by gandhit
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |