sub getdimen { my $rows = @_; # get number of rows my $cols = @$_[0]; # get number of elems in first row return ($rows,$columns); }