But, as written (eg, with commas), it works

...so if it's not "THE (emphasis supplied, though absent from the original) accepted way" it might be less-preferred, but NOT UN-useable, so long as you know what you're you're doing (why and on what sort of data).

TIMTOWTDI

updated with more qualifications after ikegami slapt me upside the head re the commas (D'oh on me) and
<STRUCK> the boneheaded misstatement above after checking perlop which VERY SPECIFICALLY says,
A common mistake is to try to separate the words with comma or to put comments into a multi-line qw-string. For this reason, the use warnings pragma and the -w switch (that is, the $^W variable) produces warnings if the STRING contains the "," or the "#" character.

This ain't my day YAUpdate: ikegami points out that "Because of the spaces after the commas, the array does have multiple elements."

and just for the record, reason2006 's clarification below is noted without further dumb-ness from /me

The language in perlop also points out - or so it now seems to me - that OP's example is NOT "using a while loop and the diamond operator to process arrays" but is rather processing a one element array containing a list or string and relying on an unreliable behavior. Does this reading comport with the wisdom of the Monks? (cf my ref to ikegami above)

So far, about the only reliable part of this node is the first line and the quote from perlop...

AAAAArgh!


In reply to Re: process array with while loop by ww
in thread process array with while loop by reason2006

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.