in reply to Gimmie the Stuff Between Two Keywords
$text =~ /XYZ:(.*?)\@mail.cp/
with a backslash before the @ to avoid string interpolation.
pike