note
Corion
<p>I some times fall for the <code>my ($self, $bar, $baz) = shift;</code> bug, but there is another bug that catches me, especially when I start to consciously think about it instead of letting my fingers interpret my commands:</p>
<code>
my $foo = 'bar';
$foo ~= s/a/ee/;
</code>
<p>Of course, this is the reversed regex operator (which doesn't exist), and Perl sees this as a syntax error. [ambrus] taught me a good mnenonic - the negated comparison for the regex binding operator is <code>!~</code>, which has the same order as <code>!=</code>, and thus,
the regex binding operator must be <code>=~</code>.</p>
<p>In a certain way this confusion when thinking about what my fingers should be doing reminds me of the problem that octopodes have when coordinating their arms, which, seemingly, they never do - [http://en.wikipedia.org/wiki/Octopus|they just send commands to them and then verify the behaviour by optical inspection].</p>
442597
442597