I came across the need tonight to make email addresses such as mary@supercalifradulistic.org into a form like mary@superc... This isn't something used to obfuscate mailing list addresses, but more to make them short so they fit on a web page nicely.
I chained a few map statements together with a concatenation, and called the email via accessor from an object. This works, but as an exercise I'm wondering how you would approach this.
@shortened_email_addresses = map { $_ . '...' } # add three dots to the end map { $_ =~ m/^(\S+@\S{6})/ } # match the first 6 after @ map { $_->email } # call the email accessor @objects;
In reply to Shorten email address by redhotpenguin
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |