Perl is my calculator

When I want to do some quick math, I find it easier to type a quick Perl command than to launch a calculator app. I always have or Cygwin rxvt open, so I type something like this:

perl -le 'print 32139 + 92176'

which yields the copy-pasteable result:


There are possible faster solutions, like Google (try typing “20 + 20” in your search bar — down arrow, select-all and copy) or Quicksilver‘s math mode on Mac. But Perl is in my muscle memory, and I can quick solutions like appending the results to a file without even thinking about it.

In the command above, I’ve included two flags: -l and -e. -l is shorthand to put a newline at the end of every print statement. -e tells Perl that the next argument will be a script to execute.