my $a = Math::BigRat->new( '1_000_000_000_000_000_000' );
my $b = Math::BigRat->new( '10_000_000_000_000_000_000' );
my $q = $a / $b;
say $q; # prints 1/10
Core module Math:BigRat (available since v5.8.0) provides handling of big rational numbers. (perl treats underscores in numbers as a group separator, used here for visual clarity.)
my $a = Math::BigRat->new( '1_000_000_000_000_000_000' );
my $b = Math::BigRat->new( '10_000_000_000_000_000_000' );
my $q = $a / $b;
say $q; # prints 1/10