use POSIX qw(log10);
$log_10 = log10(VALUE);

For other bases, use the mathematical identity:

where *x* is the number whose logarithm you want,
*n* is the desired base, and
*e* is the natural logarithm base.

sub log_base {
my ($base, $value) = @_;
return log($value)/log($base);
}