I came up with the following, which works for my use-case ...
Note that the floating point value 1/3 is not the same as the rational value 1/3, and while your subroutine works as you want for your use case, it won't work correctly for (eg)
cube_root( -91197 ** 3 ), where it will return -91196.9999999999.
For general purposes, you therefore really need an implementation that performs cbrt(x), as opposed to pow(x, 1 / 3).
haukex has already shown that the excellent Math::Prime::Util::GMP module provides what you're after.
My own Math::MPFR module provides the same capability (courtesy of
the mpfr C library):
C:\>perl -MMath::MPFR=":mpfr" -le "$op = Math::MPFR->new(-9117 ** 3);
+Rmpfr_cbrt($op, $op, MPFR_RNDN); print $op;"
-9.117e3
or, the more general:
C:\>perl -MMath::MPFR=":mpfr" -le "$op = Math::MPFR->new(-9117 ** 3);
+Rmpfr_rootn_ui($op, $op, 3, MPFR_RNDN); print $op;"
-9.117e3
Cheers,
Rob