in reply to using callback function

$#$x will print the last subscript value of the refered array. To find number of contents $#$x has to be $#$x + 1.

Now the subroutine h will be called inside the subroutine j.

sub h { my ($x,$y)=@_; print "the val of x is $#$x and y is $#$y\n"; } sub j { my ($i, $j, $k)=@_; print "\ni am in the function j\n\n"; &$k($i,$j); } @ar = qw/1 2 3 4/; @vr = qw/56 7 8 9/; &j (\@ar, \@vr, \&h);