in reply to Shorten email address

map { $_ =~ m/^(\S+@\S{6})/ } # match the firs +t 6 after @
That matches exactly 6 (non-whitespace) characters after the @...not 7, not 5, but exactly 6.

While this works for most, it won't work for me@x.tv. So your @shortened_email_addresses won't match one-to-one with @objects, and you might end up creating wrong mailto: links.

Use m/^(\S+@\S{1,6})/ instead.

-QM
--
Quantum Mechanics: The dreams stuff is made of