/calc

Commandline REPL calculator

Primary LanguagePerl

NAME

calc.pl - Simple perl REPL calculator

SYNOPSIS

$ calc.pl
calc> 2 * pi
6.2831852
calc> @ * 10
62.831852
calc> $5,300.27 * 2.03
$10,759.5481

DESCRIPTION

Based upon the sample code from https://metacpan.org/pod/Term::ReadLine

To get readline working properly on OSX, I installed Term::ReadLine::Gnu following the instructions from http://blogs.perl.org/users/aristotle/2013/07/easy-osx-termreadlinegnu.html

Readline is already installed, but the Makefile doesn't pick it up, so make homebrew install some temporary symlinks.

dave> brew install readline
dave> brew link --force readline
dave> sudo su -
root> cpan Term::ReadLine::Gnu
root> exit
dave> brew unlink readline

Also needs the non-core File::HomeDir for storing the history file.

LICENSE

This script is free software; you can redistribute it and/or modify it under the same terms as perl itself.