calc will look in your home directory for a file called ".calc.code". If one is present, it will read the contents and eval() it. This is a handy way to predefine some functions and constants (such as $PI). calc will also look in the current working directory (if different) for another ".calc.code" file. If one is present, it too will be read and eval()'d. I've prepopulated this .calc.code with some handy functions, which are documented in comment lines in .calc.code itself. Note that .calc.code now tries to include Math::Trig and LWP::Simple, which should be standard with all reasonably recent perl5 distributions. If yours does not, for some ungodly reason, you can comment it out of your .calc.code file. Since some of the functions in this .calc.code rely on /usr/dict/words or the "units" utility, these should be installed (if they aren't already). They should be made available from wherever you got this "calc" distrib, but if they weren't you should be able to get them from: http://www.ciar.org/ttk/codecloset/calc/optional/ These are the functions available through this version of .calc.code: sub units # wrapper around external units utility, for converting between units (eg: units('5 km','mile') = 3.106856). You can find "units" in the "optional" directory of the same place you got calc. sub u # same as units(), but shorter for fewer keystrokes sub punits # given units to convert from, and to, and a bunch of values, converts each value to desired unit sub pu # same as punits(), but shorter for fewer keystrokes sub u_cvt # convert value (assumed of type default_unit if no units given) to equivalent value in different units sub spell # greps /usr/dict/words for given words sub padtowith # pad the left hand side of the argument to a desired length using given character for padding sub padi # pad the left hand side of an integer to a desired length using zeros sub pads # pad the left hand side of a string to a desired length using spaces sub rd_f # reads entire contents of named file to a string and returns that string sub wr_f # writes a string to a named file (file is overwritten if it exists) sub ap_f # appends a string to a named file sub ke # returns the kinetic energy of a body in motion sub f2c # converts degrees fahrenheit to degrees centigrade sub c2f # converts degrees centigrade to degrees fahrenheit sub psi2bhn # converts typical steel ultimate tensile strength to Brinell Hardness Number sub bhn2psi # converts Brinell Hardness Number to typical steel ultimate tensile strength sub hv2bhn # converts Hardness Vickers to Brinell Hardness Number sub bhn2hv # converts Brinell Hardness Number to Hardness Vickers sub hrc2bhn # converts Rc hardness to Brinell Hardness Number sub boxes # given length, width, height, and thicknesses of front, back, side, top, and density, returns the mass of a hollow box sub gimme_stock # queries yahoo.com for current stock price and change in price sub me2te # given mass efficiency and density, returns thickness efficiency sub te2me # given thickness efficiency and density, returns mass efficiency sub pc # estimate modern small-arms bullet penetration into rha sub l # wraps argument in a well-defined logging syntax, for easy extraction from .calc.tickertape sub factor # returns the factors of the argument sub bench # a function for benchmarking snippits of code sub ponce0 # a lousy implementation of ponce's formula for low-velocity small-caliber bullet penetration into low-density materials sub ponce # a better implementation of ponce's penetration formula sub heat_dop # estimates depth of penetration for shaped charges sub recoil # estimates large caliber gun recoil sub setundef # passed a ref and a value, assigns the value to the ref target iff that target is undefined. sub absolute # return the absolute value of the argument sub sigma # return the sigma of arguments sub average # return the average of arguments sub hash_to_string # serialize the contents of a hash into a string sub rndto # used by gunspec(): round numeric argument to a given precision sub spec2force # used by gunspec() sub spec2throw # used by gunspec() sub specglob # used by gunspec() sub gunspec # given parameters of a large-bore gun and its projectile, estimate muzzle velocity and a few other attributes sub r2d # convert radians to degrees sub d2r # convert degrees to radians sub tokenize_list # convert a string to a list of tokens, paying attention to string delimiters and character escapes (useful for parsing SQL, et al) sub anderson # returns estimated depth of penetration of hypervelocity long-rods