chandantul has asked for the wisdom of the Perl Monks concerning the following question:

This node falls below the community's threshold of quality. You may see it by logging in.

Replies are listed 'Best First'.
Re: How i can set the minimum value of a row 1?
by marto (Cardinal) on Feb 16, 2021 at 16:22 UTC

    What is your problem? Which modules are you using? Several have a row_range() method. Please read and understand How do I post a question effectively?. These methods tend to return the minimum and maximum defined rows in a worksheet. You can set $row_min to whatever you want, e.g. $row_min = 1;, but depending on what exactly you're trying to do this may not do what you think it does.

      Have fixed the issue by declaring "my row_min = 1" as global valriable

        Make sure you are using strict. The 'vars' option of strict would have caught that the variable wasn't in scope.


        Dave

Re: How i can set the minimum value of a row 1?
by linuxer (Curate) on Feb 16, 2021 at 21:13 UTC

    Assuming the method row_range() returns two or more values and you are only interested in the second one, you could use a slice:

    my $row_min = 1; my $row_max = ( $worksheet->row_range() )[1];

    But maybe it makes more sense to read the module's documentation. Maybe there is a dedicated method to return the value for row_max.

    edit:

    Or simply overwrite $row_min after the call of row_range().

    my ( $row_min, $row_max ) = $worksheet->row_range(); $row_min = 1;

      Thanks . This resolved the issue