in reply to Re: the variable is not getting assigned
in thread the variable is not getting assigned

IMHO both variations suffer from escapism.

When I have to insert double quotes into a double quoted string, I will most likely use qq for better readability:

my $message = qq(<event id="ALERT_${tier}_$code1" source="APP">);

YMMV