Date: 2011aug3
Source: Talk by Damian Conway
Language: Perl
Q. Any obscure operators in perl 5?
A. Did you know about the "tends to" operator in Perl?
Like Calculus limits.
Looks like -->
For example:
$count = 10;
while ($count --> 0) {
print "$count\n";
}
This is a joke. Its really the familiar decrement (--) and greater than (>) squished together :)
ie:
$count = 10;
while ($count-- > 0) {
print "$count\n";
}
Perl will run both these examples the same.
Apparently it works in C and other languages. Impress your friends with the mysterious "tends to" operator.