##
use Carp qw/croak/; # put near the top of your program
sub function {
if ( @_ != 2) {
croak("function() requires two arguments");
}
my ( $x, $y ) = @_;
# ... body of function
}
####
sub fp_equal {
my ($X, $Y, $POINTS) = @_;
my ($tX, $tY);
$tX = sprintf("%.${POINTS}g", $X);
$tY = sprintf("%.${POINTS}g", $Y);
return $tX eq $tY;
}