If I'm interpreting this right, you want to find out if a particular ipv6 address (google.com's) is contained within a routing table entry (network/netmask), and print the route if it is.
If so, then:
Acquire google.com's ipv6 address, e.g. with
host -t aaaa
Get a list of all ipv6 routes. e.g. with
ip -6 route show. or query your routing daemon for a list.
For each ipv6 route, check if google.com's ipv6 address is contained within that network and netmask.
Net::CIDR module has a
cidrlookup() function for checking if an IP address is in a net block (or array of net blocks) - it works with both ipv4 and ipv6 addresses.
perl also has a
Net::DNS module for doing DNS lookups, and probably has module(s) for fetching routing tables from various routers/routing-daemons - perl has a module (or two. or a dozen) to do almost anything you can think of. It's easy enough to extract what you need from the output of
ip -6 route show anyway.
NOTE: this will only find matches where there is a specific route in your routing table for a network/mask which contains your target IP. The "default" route contains every IP, of course.
If you prefer not to use
perl, there's also libcidr. Shouldn't be too hard to write your own (or someone may already have done it).