我下面有一些 Perl 代码:
my $formattedUserEmail = $[UserEmail];
$additionalTestParameters .= "ECJOBLink,$jobLink;ECJOBId,$[jobId];EcJobCounter,$jobCounter,PFUser,$formattedUserEmail";
当 Perl 代码运行时,我看到下面每个 var 的内容:
my $formattedUserEmail = [email protected];
$additionalTestParameters .= "ECJOBLink,$jobLink;ECJOBId,1111;EcJobCounter,$jobCounter,PFUser,$formattedUserEmail";
但是当代码运行时,它会导致错误,我相信是因为[email protected]
电子邮件地址,特别是@
字符,这是 Perl 中的特殊符号。
Array found where operator expected at ... line 32, at end of line
syntax error at .... line 32, near "adam@site"
Global symbol "@site" requires explicit package name at C.... line 32.
Execution of ..... aborted due to compilation errors.
如何修复我的代码以便将电子邮件变量添加到字符串中$additionalTestParameters
?