rici has the correct answer. To demonstrate the difference required to access such environment entries, bash requires you to parse the environment as text:
$ env A.B=C perl -E 'say $ENV{"A.B"}'
C
$ env A.B=C bash -c 'val=$(env | grep -oP "^A\.B=\K.*"); echo "$val"'
C