Beefy Boxes and Bandwidth Generously Provided by pair Networks
Come for the quick hacks, stay for the epiphanies.
 
PerlMonks  

How i can set the minimum value of a row 1?

by chandantul (Scribe)
on Feb 16, 2021 at 16:16 UTC ( [id://11128452]=perlquestion: print w/replies, xml ) Need Help??

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

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: perlquestion [id://11128452]
Approved by Corion
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others scrutinizing the Monastery: (6)
As of 2024-04-20 02:30 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found