use a proper email parser:
My example parse all emails out of the text and then print only the email addresses, that start with constant=
use Email::Address;
my @add = Email::Address->parse(<<'__TXT__');
f834bkg94halUF9deju hHFDUO()NFRS432 DSFadsfg94hHFDUO()N
hfedls74d8oHFx constant=barney@gmail.com alUF9dejuH()NF
UO()NFRS432 DSFadsf4halUF9deju fedls74d8oH sfg94hHFDUOf
f834bkg94halUF9deju hHFDUO()NFRS432 DSFadsfg94hHFDUO()N
hfedls74d8oHFx constant=wilma@aol.com alUF9dejuH()NFui0
UO()NFRS432 DSFadsf4halUF9deju fedls74d8oH sfg94hHFDUOf
__TXT__
for my $add (@add) {
local $_ = $add->address;
next unless s/^constant=//;
print $_, $/;
}
output:
barney@gmail.com
wilma@aol.com