Mr. Shawn H. Corey wrote:
> On Mon, 2008-10-13 at 14:04 +0100, Rob Dixon wrote:
>>
>> A program with arrays that are tied in one place and not in another has
>> bigger problems than this anyway. But I don't see a problem with using $" 
>> with tied arrays, unless the tied class happens to overload
>> stringification.
>>
>>   print join(',', @array), "\n";
>>
>> is a lot noisier and IMO clumsier than
>>
>>   {
>>     local $" = ',';
>>     print "@array\n";
>>   }
>>
>> and after all, even if you don't know what $" does it's very simple to
>> look it up and also easy to remember.
> 
> I disagree.  Remembering what all these cussing variables do is not
> easy.  Just because you know what they are, doesn't imply that anyone
> who has to maintain your code will know.  Use English or use join.
> 
> use English;
> {
>   local $LIST_SEPARATOR = ',';
>   print "@array\n";
> }

Then we must remain in disagreement. I believe that because

  perldoc perlvar

is so easy to access, and because it also provides mnemonics for each symbolic
variable, the Huffman encoding principle is paramount here.

Also I assume that your 'cussing variables' don't include all of the symbolic
variables, and that you have your own arbitrary list of which are acceptable and
which are not? I have never seen $ARG used, but I suggest that if you recommend
$LIST_SEPARATOR then you should also support $INPUT_RECORD_SEPARATOR,
$OUTPUT_AUTOFLUSH and so on. And then you would have all the people who know the
symbolic variable rushing to read the documentation to see if they mean the same
thing.

My preference is to use the symbolic variables sparingly, and to comment their
use if I judge that there is a likelihood of confusion. I would never use the
English module, for the reason I have described.

Rob

-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
http://learn.perl.org/


Reply via email to