Beefy Boxes and Bandwidth Generously Provided by pair Networks
"be consistent"
 
PerlMonks  

comment on

( [id://3333]=superdoc: print w/replies, xml ) Need Help??
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":



  • 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 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?Last hourOther CB clients
Other Users?
Others having a coffee break in the Monastery: (3)
As of 2024-04-18 19:46 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found