Hilbert Curve in Perl 

use Math::PlanePath::HilbertCurve;

my $path = Math::PlanePath::HilbertCurve->new;

my($x, $y) = $path->n_to_xy(123);