NAME
Math::NumberCruncher - Very useful, commonly needed math/statistics/geometric functions.
SYNOPSIS
It should be noted that as of v4.0, there is now an OO interface to Math::NumberCruncher. For backwards compatibility, however, the previous, functional style will always be supported.
# OO Style
use Math::NumberCruncher;
$ref = Math::NumberCruncher->new();
# From this point on, all of the subroutines show below will be available through $ref (i.e., ( $high,$low ) = $ref->Range(\@array)). For the sake of brevity, consult the functional documentation (below) for the use of specific functions.
# Functional Style
use Math::NumberCruncher;
($high, $low) = Math::NumberCruncher::Range(\@array);
$mean = Math::NumberCruncher::Mean(\@array);
$median = Math::NumberCruncher::Median(\@array);
$odd_median = Math::NumberCruncher::OddMedian(\@array);
$mode = Math::NumberCruncher::Mode(\@array);
$covariance = Math::NumberCruncher::Covariance(\@array1, \@array2);
$correlation = Math::NumberCruncher::Correlation(\@array1, \@array2);
($slope, $y_intercept) = Math::NumberCruncher::BestFit(\@array1, \@array2);
$distance = Math::NumberCruncher::Distance($x1,$y1,$z1,$x2,$y2,$z2);
$distance = Math::NumberCruncher::Distance($x1,$y1,$x1,$x2);
$distance = Math::NumberCruncher::ManhattanDistance($x1,$y1,$x2,$y2);
$probAll = Math::NumberCruncher::AllOf('0.3','0.25','0.91','0.002');
$probNone = Math::NumberCruncher::NoneOf('0.4','0.5772','0.212');
$probSome = Math::NumberCruncher::SomeOf('0.11','0.56','0.3275');
$factorial = Math::NumberCruncher::Factorial($some_number);
$permutations = Math::NumberCruncher::Permutation($n);
$permutations = Math::NumberCruncher::Permutation($n,$k);
$roll = Math::NumberCruncher::Dice(3,12,4);
$randInt = Math::NumberCruncher::RandInt(10,50);
$randomElement = Math::NumberCruncher::RandomElement(\@array);
Math::NumberCruncher::ShuffleArray(\@array);
@unique = Math::NumberCruncher::Unique(\@array);
@a_only = Math::NumberCruncher::Compare(\@a,\@b);
@union = Math::NumberCruncher::Union(\@a,\@b);
@intersection = Math::NumberCruncher::Intersection(\@a,\@b);
@difference = Math::NumberCruncher::Difference(\@a,\@b);
$gaussianRand = Math::NumberCruncher::GaussianRand();
$ways = Math::NumberCruncher::Choose($n,$k);
$binomial = Math::NumberCruncher::Binomial($attempts,$successes,$probability);
$gaussianDist = Math::NumberCruncher::GaussianDist($x,$mean,$variance);
$StdDev = Math::NumberCruncher::StandardDeviation(\@array);
$variance = Math::NumberCruncher::Variance(\@array);
@scores = Math::NumberCruncher::StandardScores(\@array);
$confidence = Math::NumberCruncher::SignSignificance($trials,$hits,$probability);
$e = Math::Numbercruncher::EMC2( "m512" [, 1] );
$m = Math::NumberCruncher::EMC2( "e987432" [, 1] );
$force = Math::NumberCruncher::FMA( "m12", "a73.5" );
$mass = Math::NumberCruncher::FMA( "a43", "f1324" );
$acceleration = Math::NumberCruncher::FMA( "f53512", "m356" );
$predicted_value = Math::NubmerCruncher::Predict( $slope, $y_intercept, $proposed_x );
$area = Math::NumberCruncher::TriangleHeron( $a, $b, $c );
$area = Math::NumberCruncher::TriangleHeron( 1,3, 5,7, 8,2 );
$perimeter = Math::NumberCruncher::PolygonPerimeter( $x0,$y0, $x1,$y1, $x2,$y2, ...);
$direction = Math::NumberCruncher::Clockwise( $x0,$y0, $x1,$y1, $x2,$y2 );
$collision = Math::NumberCruncher::InPolygon( $x, $y, @xy );
@points = Math::NumberCruncher::BoundingBox_Points( $d, @p );
$in_triangle = Math::NumberCruncher::InTriangle( $x,$y, $x0,$y0, $x1,$y1, $x2,$y2 );
$area = Math::NumberCruncher::PolygonArea( 0, 1, 1, 0, 2, 0, 3, 2, 2, 3 );
$area = Math::NumberCruncher::CircleArea( $diameter );
$circumference = Math::NumberCruncher::Circumference( $diameter );
$volume = Math::NumberCruncher::SphereVolume( $radius );
$surface_area = Math::NumberCruncher::SphereSurface( $radius );
$years = Math::NumberCruncher::RuleOf72( $interest_rate );
$volume = Math::NumberCruncher::CylinderVolume( $radius, $height );
$volume = Math::NumberCruncher::ConeVolume( $lowerBaseArea, $height );
$radians = Math::NumberCruncher::deg2rad( $degrees );
$degrees = Math::NumberCruncher::rad2deg( $radians );
$Fahrenheit = Math::NumberCruncher::C2F( $Celsius );
$Celsius = Math::NumberCruncher::F2C( $Fahrenheit );
$cm = Math::NumberCruncher::in2cm( $inches );
$inches = Math::NumberCruncher::cm2in( $cm );
$ft = Math::NumberCruncher::m2ft( $m );
$m = Math::NumberCruncher::ft2m( $ft );
$lb = Math::NumberCruncher::kg2lb( $kg );
$kg = Math::NumberCruncher::lb2kg( $lb );
$RelativeStride = Math::NumberCruncher::RelativeStride( $stride_length, $leg_length );
$RelativeStride = Math::NumberCruncher::RelativeStride_2( $DimensionlessSpeed );
$DimensionlessSpeed = Math::NumberCruncher::DimensionlessSpeed( $RelativeStride );
$ActualSpeed = Math::NumberCruncher::ActualSpeed( $leg_length, $DimensionlessSpeed );
$eccentricity = Math::NumberCruncher::Eccentricity( $half_major_axis, $half_minor_axis );
$LatusRectum = Math::NumberCruncher::LatusRectum( $half_major_axis, $half_minor_axis );
$EllipseArea = Math::NumberCruncher::EllipseArea( $half_major_axis, $half_minor_axis );
$OrbitalVelocity = Math::NumberCruncher::OrbitalVelocity( $r, $a, $M [, $iterations] );
$SqrRoot = Math::NumberCruncher::SqrRoot( $number [, $iterations] );
$arcsin = Math::NumberCruncher::asin( $x );
$arccos = Math::NumberCruncher::acos( $x );
$arctan = Math::NumberCruncher::atan( $x );
$arccot = Math::NumberCruncher::acot( $x );
$arcsec = Math::NumberCruncher::asec( $x );
$secant = Math::NumberCruncher::sec( $x );
$cosecant = Math::NumberCruncher::csc( $x );
$exsecant = Math::NumberCruncher::exsec( $x );
$tangent = Math::NumberCruncher::tan( $x );
$cotangent = Math::NumberCruncher::cot( $x );
$versine = Math::NumberCruncher::vers( $x );
$coversine = Math::NumberCruncher::covers( $x );
$haversine = Math::NumberCruncher::hav( $x );
$grouped = Math::NumberCruncher::Commas( $number );
$root = Math::NumberCruncher::Root( 55, 3 [, $iterations] );
$root = Math::NumberCruncher::Root2( 55, 3 [, $decimal_places] );
$log = Math::NumberCruncher::Ln( 100 [, $decimal_places] );
$num = Math::NumberCruncher::Exp( 0.111 [, $decimal_places] );
( $A, $B, $C ) = Math::NumberCruncher::PythagTriples( $x, $y );
$z = Math::NumberCruncher::PythagTriplesSeq( $x, $y );
DESCRIPTION
This module is a collection of commonly needed number-related functions, including numerous standard statistical, geometric, and probability functions. Some of these functions are taken directly from _Mastering Algorithms with Perl_, by Jon Orwant, Jarkko Hietaniemi, and John Macdonald, and others are adapted heavily from same. The remainder are either original functions written by the author, or original adaptations of standard algorithms. Some of the functions are fairly obvious, others are explained in greater detail below. For all calculations involving pi, the value of pi is taken out to 500 places. Overkill? Probably, but it is better, in my opinion, to have too much accuracy as opposed to not enough. I've also included the value of e and g (Newton's gravitational constant) out to 500 places. These are available for export as $PI, $_e_, and $_g_.
EXAMPLES
($high,$low) = Math::NumberCruncher::Range(\@array);
Returns the largest and smallest elements in an array.
$mean = Math::NumberCruncher::Mean(\@array);
Returns the mean, or average, of an array.
$median = Math::NumberCruncher::Median(\@array);
Returns the median, or the middle, of an array. The median may or may not be an element of the array itself.
$odd_median = Math::NumberCruncher::OddMedian(\@array);
Returns the odd median, which, unlike the median, *is* an element of the array. In all other respects it is similar to the median.
$mode = Math::NumberCruncher::Mode(\@array);
Returns the mode, or most frequently occurring item, of @array.
$covariance = Math::NumberCruncher::Covariance(\@array1,\@array2);
Returns the covariance, which is a measurement of the correlation of two variables.
$correlation = Math::NumberCruncher::Correlation(\@array1,\@array2);
Returns the correlation of two variables. Correlation ranges from 1 to -1, with a correlation of zero meaning no correlation exists between the two variables.
($slope,$y_intercept ) = Math::NumberCruncher::BestFit(\@array1,\@array2);
Returns the slope and y-intercept of the line of best fit for the data in question.
$distance = Math::NumberCruncher::Distance($x1,$y1,$x1,$x2);
Returns the Euclidian distance between two points. The above example demonstrates the use in two dimensions. For three dimensions, usage would be $distance = Math::NumberCruncher::Distance($x1,$y1,$z1,$x2,$y2,$z2);>
$distance = Math::NumberCruncher::ManhattanDistance($x1,$y1,$x2,$y2);
Modified two-dimensional distance between two points. As stated in _Mastering Algorithms with Perl_, "Helicopter pilots tend to think in Euclidian distance, good New York cabbies tend to think in Manhattan distance." Rather than distance "as the crow flies," this is distance based on a rigid grid, or network of streets, like those found in Manhattan.
$probAll = Math::NumberCruncher::AllOf('0.3','0.25','0.91','0.002');
The probability that all of the probabilities in question will be satisfied. (i.e., the probability that the Steelers will win the SuperBowl and that David Tua will win the World Heavyweight Title in boxing.)
$probNone = Math::NumberCruncher::NoneOf('0.4','0.5772','0.212');
The probability that none of the probabilities in question will be satisfied. (i.e., the probability that the Steelers will not win the SuperBowl and that David Tua will not win the World Heavyweight Title in boxing.)
$probSome = Math::NumberCruncher::SomeOf('0.11','0.56','0.3275');
The probability that at least one of the probabilities in question will be satisfied. (i.e., the probability that either the Steelers will win the SuperBowl or David Tua will win the World Heavyweight Title in boxing.)
$factorial = Math::NumberCruncher::Factorial($some_number);
The number of possible orderings of $factorial items. The factorial n! gives the number of ways in which n objects can be permuted.
$permutations = Math::NumberCruncher::Permutation($n);
The number of permutations of $n elements.
$permutations = Math::NumberCruncher::Permutation($n,$k);
The number of permutations of $k elements drawn from a set of $n elements.
$roll = Math::NumberCruncher::Dice($number,$sides,$plus);
The obligatory dice rolling routine. Returns the result after passing the number of rolls of the die, the number of sides of the die, and any additional points to be added to the roll. As commonly seen in role playing games, 4d12+5 would be expressed as Dice(4,12,5). The function defaults to a single 6-sided die rolled once without any points added.
$randInt = Math::NumberCruncher::RandInt(10,50);
Returns a random integer between the two number passed to the function, inclusive. With no parameters passed, the function returns either 0 or 1.
$randomElement = Math::NumberCruncher::RandomElement(\@array);
Returns a random element from @array.
Math::NumberCruncher::ShuffleArray(\@array);
Shuffles the elements of @array and returns them.
@unique = Math::NumberCruncher::Unique(\@array);
Returns an array of the unique items in an array.
@a_only = Math::NumberCruncher::Compare(\@a,\@b);
Returns an array of elements that appear only in the first array passed. Any elements that appear in both arrays, or appear only in the second array, are discarded.
@union = Math::NumberCruncher::Union(\@a,\@b);
Returns an array of the unique elements produced from the joining of the two arrays.
@intersection = Math::NumberCruncher::Intersection(\@a,\@b);
Returns an array of the elements that appear in both arrays.
@difference = Math::NumberCruncher::Difference(\@a,\@b);
Returns an array of the symmetric difference of the two arrays. For example, in the words of _Mastering Algorithms in Perl_, "show me the web documents that talk about Perl or about sets but not those that talk about both.
$gaussianRand = Math::NumberCruncher::GaussianRand();
Returns one or two floating point numbers based on the Gaussian Distribution, based upon whether the call wants an array or a scalar value.
$ways = Math::NumberCruncher::Choose($n,$k);
The number of ways to choose $k elements from a set of $n elements, when the order of selection is irrelevant.
$binomial = Math::NumberCruncher::Binomial($n,$k,$p);
Returns the probability of $k successes in $n tries, given a probability of $p. (i.e., if the probability of being struck by lightning is 1 in 75,000, in 100 days, the probability of being struck by lightning exactly twice would be expressed as Binomial('100','2','0.0000133'))
$probability = Math::NumberCruncher::GaussianDist($x,$mean,$variance);
Returns the probability, based on Gaussian Distribution, of our random variable, $x, given the $mean and $variance.
$StdDev = Math::NumberCruncher::StandardDeviation(\@array);
Returns the Standard Deviation of @array, which is a measurement of how diverse your data is.
$variance = Math::NumberCruncher::Variance(\@array);
Returns the variance for @array, which is the square of the standard deviation. Or think of standard deviation as the square root of the variance. Variance is another indicator of the diversity of your data.
@scores = Math::NumberCruncher::StandardScores(\@array);
Returns an array of the number of standard deviations above the mean for @array.
$confidence = Math::NumberCruncher::SignSignificance($trials,$hits,$probability);
Returns the probability of how likely it is that your data is due to chance. The lower the confidence, the less likely your data is due to chance.
$e = Math::NumberCruncher::EMC2( "m36" [, 1] );
Implementation of Einstein's E=MC**2. Given either energy or mass, the function returns the other. When passing mass, the value must be preceeded by a "m," which may be either upper or lower case. When passing energy, the value must be preceeded by a "e," which may be either upper or lower case. The function defaults to using kilometers per second for the speed of light. To make the function use miles per second for the speed of light, simply pass any non-zero value as the second value.
$force = Math::NumberCruncher::FMA( "m97", "a53" );
Implementation of the stadard force = mass * acceleration formula. Given two of the three variables (i.e., mass and force, mass and acceleration, or acceleration and force), the function returns the third. When passing the values, mass must be preceeded by a "m," force must be preceeded by a "f," and acceleration must be preceeded by an "a." Case is irrelevant.
$predicted = Math::NumberCruncher::Predict( $slope, $y_intercept, $proposed_x );
Useful for predicting values based on data trends, as calculated by BestFit(). Given the slope and y-intercept, and a proposed value of x, returns corresponding y.
$area = Math::NumberCruncher::TriangleHeron( $a, $b, $c );
Calculates the area of a triangle, using Heron's formula. TriangleHeron() can be passed either the lengths of the three sides of the triangle, or the (x,y) coordinates of the three verticies.
$perimeter = Math::NumberCruncher::PolygonPerimeter( $x0,$y0, $x1,$y1, $x2,$y2, ...);
Calculates the length of the perimeter of a given polygon.
$direction = Math::NumberCruncher::Clockwise( $x0,$y0, $x1,$y1, $x2,$y2 );
Given three pairs of points, returns a positive number if you must turn clockwise when moving from p1 to p2 to p3, returns a negative number if you must turn counter-clockwise when moving from p1 to p2 to p3, and a zero if the three points lie on the same line.
$collision = Math::NumberCruncher::InPolygon( $x, $y, @xy );
Given a set of xy pairs (@xy) that define the perimeter of a polygon, returns a 1 if point ($x,$y) is inside the polygon and returns 0 if the point ($x,$y) is outside the polygon.
@points = Math::NumberCruncher::BoundingBox_Points( $d, @p );
Given a set of @p points and $d dimensions, returns two points that define the upper left and lower right corners of the bounding box for set of points @p.
$in_triangle = Math::NumberCruncher::InTriangle( $x,$y, $x0,$y0, $x1,$y1, $x2,$y2 );
Returns true if point $x,$y is inside the triangle defined by points ($x0,$y0), ($x1,$y1), and ($x2,$y2)
$area = Math::NumberCruncher::PolygonArea( 0, 1, 1, 0, 3, 2, 2, 3, 0, 2 );
Calculates the area of a polygon using determinants.
$area = Math::NumberCruncher::CircleArea( $diameter );
Calculates the area of a circle, given the diameter.
$circumference = Math::NumberCruncher::Circumference( $diameter );
Calculates the circumference of a circle, given the diameter.
$volume = Math::NumberCruncher::SphereVolume( $radius );
Calculates the volume of a sphere, given the radius.
$surface_area = Math::NumberCruncher::SphereSurface( $radius );
Calculates the surface area of a sphere, given the radius.
$years = Math::NumberCruncher::RuleOf72( $interest_rate );
A very simple financial formula. It calculates how many years, at a given interest rate, it will take to double your money, provided that the money and all interest is left in the account.
$volume = Math::NumberCruncher::CylinderVolume( $radius, $height );
Calculates the volume of a cylinder given the radius and the height.
$volume = Math::NumberCruncher::ConeVolume( $lowerBaseArea, $height );
Calculates the volume of a cone given the lower base area and the height.
$radians = Math::NumberCruncher::deg2rad( $degrees );
Converts degrees to radians.
$degrees = Math::NumberCruncher::rad2deg( $radians );
Converts radians to degrees.
$Fahrenheit = Math::NumberCruncher::C2F( $Celsius );
Converts Celsius to Fahrenheit.
$Celsius = Math::NumberCruncher::F2C( $Fahrenheit );
Converts Fahrenheit to Celsius.
$cm = Math::NumberCruncher::in2cm( $inches );
Converts inches to centimeters.
$inches = Math::NumberCruncher::cm2in( $cm );
Converts centimeters to inches.
$ft = Math::NumberCruncher::m2ft( $m );
Converts meters to feet.
$m = Math::NumberCruncher::ft2m( $ft );
Converts feet to meters.
$lb = Math::NumberCruncher::kg2lb( $kg );
Converts kilograms to pounds.
$kg = Math::NumberCruncher::lb2kg( $lb );
Converts pounds to kilograms.
$RelativeStride = Math::NumberCruncher::RelativeStride( $stride_length, $leg_length );
Welcome to the world of ichnology. This was originally for a dinosaur simulation I have been working on. This and the following four routines are all part of determining the speed of a dinosaur (or any other animal, including people), based on leg measurements and stride measurements. Ichnology is study of trace fossils (i.e., nests, eggs, fossilized dung...seriously, that's not a joke), and in this case, fossilized footprints, or trackways. RelativeStride() is for determining the relative stride of the animal given stride length and leg length.
$RelativeStride = Math::NumberCruncher::RelativeStride_2( $DimensionlessSpeed );
This differs from the previous routine in that it calculates relative stride based on dimensionless speed, rather than stride and leg length.
$DimensionlessSpeed = Math::NumberCruncher::DimensionlessSpeed( $RelativeStride );
Dimensionless speed is a calculated value that relates the speed of an animal to leg length and stride length.
$DimensionlessSpeed = Math::NumberCruncher::DimensionlessSpeed_2( $speed, $legLength );
This differs from the previous routine in that it calculates dimensionless speed based on actual speed and leg length.
$ActualSpeed = Math::NumberCruncher::ActualSpeed( $leg_length, $DimensionlessSpeed );
This is the really interesting one. Given leg length and dimensionless speed, it returns the actual speed (or absolute speed) of the animal in question in distance per second. There is no unit of measure conversion performed, so if you pass it measurements in meters, the answer is in meters per second. If you pass it measurements in inches, it returns inches per second, and so on.
$eccentricity = Math::NumberCruncher::Eccentricity( $half_major_axis, $half_minor_axis );
Calculates the eccentricity of an ellipse, given the semi-major axis and the semi-minor axis.
$LatusRectum = Math::NumberCruncher::LatusRectum( $half_major_axis, $half_minor_axis );
Calculates the latus rectum of an ellipse, given the semi-major axis and the semi-minor axis.
$EllipseArea = Math::NumberCruncher::EllipseArea( $half_major_axis, $half_minor_axis );
Calculates the area of an ellipse, given the semi-major axis and the semi-minor axis.
$OrbitalVelocity = Math::NumberCruncher::OrbitalVelocity( $r, $a, $M [, $iterations] );
Calculates orbital velocity of an object given the radial distance at a given point on an elliptical orbit, the mean distance of the central object, and the mass of the central object. As with SqrRoot(), $iterations is optional and defaults to 5.
$SqrRoot = Math::NumberCruncher::SqrRoot( $number [, $iterations] );
Calculates the square root of a number out to an arbitrary number of decimal places. This uses the averaging method and defaults to 5 iterations unless otherwise specified. In most cases, 5 iterations is easily sufficient. Regardless of the number of iterations, the loop ends if the current guess at the root is equal to the previous guess. It should be noted that this method is substantially slower than the built-in sqrt() function. However, especially with large numbers, this method is far more accurate.
$arcsin = Math::NumberCruncher::asin( $x );
Calculates the inverse sine.
$arccos = Math::NumberCruncher::acos( $x );
Calculates the inverse cosine.
$arctan = Math::NumberCruncher::atan( $x );
Calculates the inverse tangent.
$arccot = Math::NumberCruncher::acot( $x );
Calculates the inverse cotangent.
$arcsec = Math::NumberCruncher::asec( $x );
Calculates the inverse secant.
$secant = Math::NumberCruncher::sec( $x );
Calculates the secant.
$cosecant = Math::NumberCruncher::csc( $x );
Calculates the cosecant.
$exsecant = Math::NumberCruncher::exsec( $x );
Calculates the exsecant.
$tangent = Math::NumberCruncher::tan( $x );
Calculates the tangent.
$cotangent = Math::NumberCruncher::cot( $x );
Calculates the cotangent.
$versine = Math::NumberCruncher::vers( $x );
Calculates the versine.
$coversine = Math::NumberCruncher::covers( $x );
Calculates the coversine.
$haversine = Math::NumberCruncher::hav( $x );
Calculates the haversine.
$grouped = Math::NumberCruncher::Commas( $number );
Performs digit grouping, making large number more visually pleasing.
$root = Math::NumberCruncher::Root( 55, 3 [, $iterations] );
Calculates the N-th root of a given number using Newton's Method. In the above example, $root is the cube root of 55. $iterations defaults to 5. While you can set $iterations as high as you like, it should be noted that each iteration gets progressivly slower.
$root = Math::NumberCruncher::Root2( 55, 3 [, $decimal_places] );
Calculates the N=th root of a given number using logarithms. In the above example, $root is the cube root of 55. You can specify the number of decimal places wanted, otherwise it defaults to 20.
$log = Math::NumberCruncher::Ln( 100 [, $decimal_places] );
Calculates the natural log of a given number to a given number of decimal places. Unless specified, the number of decimal places defaults to 20.
$num = Math::NumberCruncher::Exp( $log [, $decimal_places] );
Performs the inverse of Ln(). Unless specified, the number of decimal places defaults to 20.
( $A, $B, $C ) = Math::NumberCruncher::PythagTriples( 5, 7 );
Calculates Pythagorian Triples based on the two numbers passed. Remember Pythagorian Triples are three numbers where the sum of the squares of the first two numbers is equal to the square of the third.
$z = Math::NumberCruncher::PythagTriplesSeq( 55, 32 );
Completes the Pythagorian Triple sequence based on the two numbers passed.
AUTHOR
Kurt Kincaid, sifukurt@yahoo.com
COPYRIGHT
Copyright (c) 2001, Kurt Kincaid. All rights reserved. This code is free software; you can redistribute it and/or modify it under the same terms as Perl itself. Several of the algorithms contained herein are adapted from _Mastering Algorithms with Perl_, by Jon Orwant, Jarkko Hietaniemi, and John Macdonald. Copyright (c) 1999 O-Reilly & Associates, Inc.
SPECIAL THANKS
Thanks to Douglas Wilson for allowing me to borrow his code for Ln(), Exp(), Root2(), and the various other supporting functions. Mr. Wilson's code is based on an algorithm described at http://www.geocities.com/zabrodskyvlada/aat/
I would also like to thank the folks at http://www.perlmonks.org for their input on optimizing Root().
SEE ALSO
perl(1).