<?xml version="1.0" encoding="windows-1252"?>
<node id="280038" title="Re: Poor Perl Idioms Explained (except not really)" created="2003-08-01 12:40:33" updated="2005-08-12 21:33:43">
<type id="11">
note</type>
<author id="194920">
diotalevi</author>
<data>
<field name="doctext">
&lt;p&gt;This is a pet peeve of mine. I really, really dislike it when people use decrement or increment on $|. If $| is already zero then decrementing it doesn't cause it to remain false, it becomes true. Ugh! I think that by using increment on $| you imply that decrement would also be sane. It isn't and the only sane way to cause $| to be false is through an assignment. Arithmetic on $| is hooey.&lt;/p&gt;&lt;p&gt;Added note: you're supposed to say $| = 1 and $| = 0. At least then you &lt;em&gt;know&lt;/em&gt; what the value of $| will be.&lt;/p&gt;&lt;code&gt;$ perl -le 'for(0..4){print $|--}'
0
1
0
1
0
$ perl -le 'for(0..4){print $|++}'
0
1
1
1
1&lt;/code&gt;</field>
<field name="root_node">
280025</field>
<field name="parent_node">
280025</field>
</data>
</node>
