in reply to Gimmie the Stuff Between Two Keywords

I think you want:

$text =~ /XYZ:(.*?)\@mail.cp/

with a backslash before the @ to avoid string interpolation.

pike