On box A I'm running: perl, v5.8.8 built for x86_64-linux-thread-multi

On box B I'm running: perl, v5.10.1 (*) built for x86_64-linux-thread-multi

Running perl -cw on box boxes says the script is clean and "use strict" is in play. After executing the script, I receive "Can't use string ("1") as an ARRAY ref while "strict refs" in use" on box B which wasn't happening on box A.

Looking through the perl changelog, I still cannot find what has changed that would cause this.

The issue is in the way that I've referenced array objects in a for loop:
for (my $i=0; $i <= $#{@alarms}; $i++) { print $alarms[$i]; }
I cannot for the life of me remember why I decided to referenc the array that way to get the index length, but I do know there was a change in the changelog that did away with $# and I'm wondering if this fell victim to that change. The solution is obviously changing the for loop to:
for (my $i=0; $i <= $#alarms; $i++) { print $alarms[$i]; }
Can anyone tell me what the difference between the array name front loaded by dollar-pound and encapsulated by curly braces than just dollar-pound-arrayname and why it no longer works?

In reply to understanding curly braces surrounding an array by kionysus

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



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.