Hi,
The dimension of the data increases by each pass by reference.
In this subroutine, @FORMATTED_OUTPUT was filled up as a 2 dimensional array $FORMATTED_OUTPUT[$i][$j]. sub ABC { ...... SOME CODE return (\$rows, \$cols, [EMAIL PROTECTED]); }
In subroutine DEF, ABC is called, and the dimension of @buffer increased to 3, ie it became a three dimensional array and the array elements can be accessed as $buffer[0][$i][$j]. sub DEF { my @buffer, $row, $col;
($$row, $$col, @buffer) = ABC('INPUT', 'Interface', 'OUTPUT', 'IP-Address');
This should be ($row, $col, $buffer) = ABC(...);
$$row = ... means store the RHS in the scalar referred to by $row, I guess this is not what you want.
@buffer = $ref_to_2d_array means the first element of @buffer will be a reference to a 2d array, reason for the extra dimension. Remove the '@' and replace it with a '$'.
Please read through the following docs perldoc perldsc perldoc perllol perldoc perlreftut perldoc perlref
PRINT (\$$row, \$$col, [EMAIL PROTECTED]); }
sub PRINT { do the prinnting of the buffer whose row and columns are also passed. Here the dimension of @buffer becomes 4. here the array elements can be accessed as $buffer[0][0][$i][$j]. }
How can I avoid the increases in dimension of datatype when passed by reference. Please help.
Regards Rajeev
-- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]