如何从字符串中打印散列,如
print "\n[*] Query : $select { query }";
相对
print "\n[*] Query : " . $select { query };
最佳答案
您可能需要消除多余的空格:
print "\n[*] Query : $select{query}";
$select
后面有一个空格, Perl 认为您已经完成了该变量的插值,并按字面意思处理以下文本(包括花括号)。
关于perl - 如何在字符串中插入 Perl 哈希元素?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/1617542/