develooper Front page | perl.fwp | Postings from February 2005

Re: "Secret" operators

Thread Previous | Thread Next
From:
Andrew Savige
Date:
February 1, 2005 17:33
Subject:
Re: "Secret" operators
Message ID:
20050202013335.36128.qmail@web50804.mail.yahoo.com
José Castro wrote:
> Apart from the "secret eskimo greeting" and the "goatse operator",
> can anyone tell me about other "secret" operators?

Let's not forget the Ton Hospel "high-precedence decrement"
operator ~- invented during a golf tournament (anyone remember
which one?).

IIRC, Ton's ~- invention allows you to eliminate the parens in:

    $y = ($x-1)*4;

by using instead:

    $y = ~-$x*4;

saving a whopping two strokes. This trick should work on any
twos complement machine -- and I'm not aware of any perl running
on any non twos complement machine.

/-\


Find local movie times and trailers on Yahoo! Movies.
http://au.movies.yahoo.com

Thread Previous | Thread Next


nntp.perl.org: Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at ask@perl.org | Group listing | About