sub to_string { my $self = shift; return "$_->{num}/$_->{den}"; } sub to_num { my $self = shift; return $_{num}/$_->{den};