3 ms·
The real WTF, in any language, is relying on precedence, rather than just using parens. I've seen some expensive boo-boos due to operator precedence mistakes (
by Roboprog 10y ago
The real WTF, in any language, is relying on precedence, rather than just using parens.
I've seen some expensive boo-boos due to operator precedence mistakes (e.g. - in C)
That said, there are a lot of special variables that can be tedious to figure out (e.g. - $" vs $;), if somebody uses the less frequently used ones, rather than the long-form names.
- falsedan 10y agoman perlvar was always pretty easy to search & explained the real purpose of whatever goofy line noise people would use
- Roboprog 10y agoYep. That's where I found $" and the other one, whatever it was :-) I can remember $_, $? and $!, but that's about it. And I like Perl.
- b2gills 10y agoThe only ones like that which exist in Perl 6 are $_ @_ %_ $! $/ The rest were either just abandoned or given names such as $GROUP or $PROGRAM-NAME $/ isn't the same as it was in Perl 5 instead it is for storing the result of successful matches. ( you can also assign to it ) $0, $1, $2 is short for $/[0], $/[1], $/[2] $<abc> is short for $/{'abc'} which can be spelled as $/<abc>
- berntb 10y ago>> operator precedence mistakes (e.g. - in C) Many years ago, I had a bookmark in my C manual (Harbinson Steele) for the operator precedence page. After a while I removed that bookmark. I decided that if I needed to look at that list, I should use parentheses. :-)
- DonHopkins 10y agoI could just drop my K&R C manual down on the spine, and it would always open up to the operator precedence page. No bookmark was necessary because I always had to open it to that page so often.
- Roboprog 10y agoThat's an important page - for reading other people's misguided cleverness.