Beefy Boxes and Bandwidth Generously Provided by pair Networks
laziness, impatience, and hubris
 
PerlMonks  

comment on

( #3333=superdoc: print w/replies, xml ) Need Help??
When you say you want to find the number of columns in each row, do you mean that you (can) have a different number of columns in each row? As Zed_Lopez mentioned, if all rows are the same size, then a single equality on the first row is all that is needed. Otherwise you'd need to loop through the array and extract the number of columns for each row. The following code again assumes you have an array of array refs:
$row = 1; foreach (@INFO_ARRAY) { print "Row $row has " . @{$INFO_ARRAY[$_]} . "columns.\n"; $row++; }
Another solution (if you wanted to retain those values) would be to populate another array with the number of elements (columns) in each row of INFO_ARRAY...
--------------------
mlh2003

In reply to Re: How do I find the size of each row of a growing multidimensional array? by mlh2003
in thread How do I find the size of each row of a growing multidimensional array? by ozgurp

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post; it's "PerlMonks-approved HTML":



  • Are you posting in the right place? Check out Where do I post X? to know for sure.
  • Posts may use any of the Perl Monks Approved HTML tags. Currently these include the following:
    <code> <a> <b> <big> <blockquote> <br /> <dd> <dl> <dt> <em> <font> <h1> <h2> <h3> <h4> <h5> <h6> <hr /> <i> <li> <nbsp> <ol> <p> <small> <strike> <strong> <sub> <sup> <table> <td> <th> <tr> <tt> <u> <ul>
  • Snippets of code should be wrapped in <code> tags not <pre> tags. In fact, <pre> tags should generally be avoided. If they must be used, extreme care should be taken to ensure that their contents do not have long lines (<70 chars), in order to prevent horizontal scrolling (and possible janitor intervention).
  • Want more info? How to link or or How to display code and escape characters are good places to start.
Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others romping around the Monastery: (3)
As of 2021-11-29 18:23 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found

    Notices?