note
kwoff
I always quote the key left of an `<CODE>=></CODE>'. It's because
I had bad experiences with earlier perl version with CGI.pm,
where things like <CODE>$q->popup_menu(-values=>[...])</CODE> would
give a warning and it took a long time for me to
figure out that `values' is a perl function. :)
<P>
I think the way I figure things out, and it's a bit
cargo-cultish; if I can't find what's causing the problem
but I found something that stops the problem, then in the
back of my mind I avoid doing whatever caused the problem.
It sometimes comes back to bite you though, because you
didn't take the time to figure out WHY there was a problem;
or otherwise, you will end up spending lots of time and
energy approaching a problem a certain way just because
you try to avoid the "dangerous" method.
So, like you say, you have these little superstitions.
Then later you might accidentally discover the real cause,
and those are happy moments of revelation. AHA!
</P>
<P>
I thought of another example of mine. I single-quote
as much as I can, in the back of my mind thinking that
maybe I'm saving a few cycles by not interpolating a
double-quoted string. :)
</P>
<P>
I also always use <CODE>qq{}</CODE> for writing SQL or HTML strings.
The reason for `<CODE>qq</CODE>' is often there are embedded quotes
in HTML, and I forget to change the outside quotes. The
reason for `<CODE>{}</CODE>' is in SQL there are often parentheses.
I try to find the most general quotation for all cases
to be consistent.
</P>
<P>
Also I tend to overuse CODE tags in perlmonks. ;)
</P>
136904
136904