Beefy Boxes and Bandwidth Generously Provided by pair Networks
Think about Loose Coupling
 
PerlMonks  

array of array max length?

by tbone654 (Beadle)
on Oct 25, 2012 at 19:59 UTC ( #1000927=perlquestion: print w/ replies, xml ) Need Help??
tbone654 has asked for the wisdom of the Perl Monks concerning the following question:

I'm trying to put something in that 11th column. Which I seem unable to do.

2012/10/05 146.91 147.16 145.70 146.14  124311600   ss 0.83 0.30 0.00
2012/10/08 145.60 146.12 145.31 145.64  124842100 B  B 0.36 0.41 0.00
2012/10/09 145.53 145.65 144.15 144.20   78415400    S 0.92 0.03 0.00
2012/10/10 144.18 144.32 143.09 143.28  148872900   ss 0.89 0.15 0.00
2012/10/11 144.28 144.49 143.33 143.36  124247500    B 0.82 0.03 0.00
2012/10/12 143.46 143.95 142.58 142.89  123601500    S 0.64 0.23 0.00
2012/10/15 143.23 144.23 142.77 144.08  124181900   ss 0.32 0.90 0.00
2012/10/16 144.76 145.64 144.66 145.54  107689100    B 0.10 0.90 0.00
2012/10/17 145.64 146.32 145.42 146.20  108815500    S 0.24 0.87 0.00
2012/10/18 145.82 146.52 145.33 145.82  128834100   ss 0.41 0.41 0.00
2012/10/19 145.55 145.56 143.05 143.39  148108500 B  B 1.00 0.14 0.00
2012/10/22 143.15 143.67 142.28 143.41  185645200    S 0.63 0.81 0.00
2012/10/23 141.86 142.06 140.83 141.42  125578600 B  B 0.84 0.48 0.00
2012/10/24 141.93 142.10 140.80 141.02  192056300    S 0.87 0.17 0.00

So on a hunch I comment out the code that populates the 10th column, and guess what? Now that calc appears in the 10th column.

2012/10/17 145.64 146.32 145.42 146.20  108815500    S 0.24 0.22 0.00
2012/10/18 145.82 146.52 145.33 145.82  128834100   ss 0.41 0.99 0.00
2012/10/19 145.55 145.56 143.05 143.39  148108500 B  B 1.00 3.47 0.00
2012/10/22 143.15 143.67 142.28 143.41  185645200    S 0.63 3.28 0.00
2012/10/23 141.86 142.06 140.83 141.42  125578600 B  B 0.84 2.84 0.00
2012/10/24 141.93 142.10 140.80 141.02  192056300    S 0.87 1.26 0.00
Q- Is there a limit on the length of an array of arrays? Is it 10? Here's the printf

printf("%10s %.2f %.2f %.2f %.2f %10d %1s %2s %00.2f %00.2f %00.2f\n", $filename[$row][0], $filename[$row][1], $filename[$row][2], $filename[$row][3], $filename[$row][4], $filename[$row-1][5], $filename[$row][6], $filename[$row][7], $filename[$row][8], $filename[$row][9]), $filename[$row][10] ;

Comment on array of array max length?
Download Code
Re: array of array max length?
by Your Mother (Canon) on Oct 25, 2012 at 20:02 UTC

    Yes, it is 10. Related limits in Perl are strings cannot be longer than 80 characters and hashes cannot have more than 12 keys.

      When was the character limit changed to 80?! I max out at 75 characters and this feature might be enough to get me to upgrade.
        That is the main difference between 32 and 64 bit versions.
        لսႽ ᥲᥒ⚪⟊Ⴙᘓᖇ Ꮅᘓᖇ⎱ Ⴙᥲ𝇋ƙᘓᖇ
Re: array of array max length?
by Not_a_Number (Parson) on Oct 25, 2012 at 20:14 UTC

    Hi tbone654.

    You say that you want to "put something in that 11th column".

    But some of your rows already have 11 columns (eg row 2).

    As for your code, I can't comment on it, since you haven't followed the guidelines for posting, so it just looks like gobbledegook to me.

    However, I can confidently reply that, in perl, the limit on array size is larger than 10!

Re: array of array max length?
by frozenwithjoy (Curate) on Oct 25, 2012 at 20:53 UTC

    Hi. It is difficult to tell exactly what your code is, since it isn't in between code tags (<c>insert_code_here</c>) and square brackets are messing things up.

    Nevertheless, I noticed what is causing your problem: Your closing parenthesis is after the 10th element, leaving the 11th just hanging out on the end.

    An example:

    $ perl -e 'printf("%.1f %.2f %.3f %.4f\n", 1, 2, 3), 4;' 1.0 2.00 3.000 0.0000 $ perl -e 'printf("%.1f %.2f %.3f %.4f\n", 1, 2, 3, 4);' 1.0 2.00 3.000 4.0000

      Nice catch... problem solved for now... Thank you...

      2012/10/15 143.23 144.23 142.77 144.08  124181900   ss 0.32 0.90 1.18
      2012/10/16 144.76 145.64 144.66 145.54  107689100    B 0.10 0.90 -0.43
      2012/10/17 145.64 146.32 145.42 146.20  108815500    S 0.24 0.87 0.22
      2012/10/18 145.82 146.52 145.33 145.82  128834100   ss 0.41 0.41 0.99
      2012/10/19 145.55 145.56 143.05 143.39  148108500 B  B 1.00 0.14 3.47
      2012/10/22 143.15 143.67 142.28 143.41  185645200    S 0.63 0.81 3.28
      2012/10/23 141.86 142.06 140.83 141.42  125578600 B  B 0.84 0.48 2.84
      2012/10/24 141.93 142.10 140.80 141.02  192056300    S 0.87 0.17 1.26
      
Re: array of array max length?
by AnomalousMonk (Abbot) on Oct 25, 2012 at 21:06 UTC

    Hi tbone654. Pre tags instead of code tags and  <a> tags for some square brackets,  &#91; ... &#93; entities for others.
    Please, please, please use code tags! Please see Writeup Formatting Tips, perhaps also Markup in the Monastery. (You can also go back and edit your original post, hint, hint.)

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others taking refuge in the Monastery: (11)
As of 2014-10-22 07:29 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    For retirement, I am banking on:










    Results (114 votes), past polls