"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
|
|