$ perl -wle'use strict; my $str2 = "@cce$$ag@!n"; print $str2;' Global symbol "@cce" requires explicit package name at -e line 1. Global symbol "$ag" requires explicit package name at -e line 1. Execution of -e aborted due to compilation errors. $ perl -wle'use strict; my $str2 = "\@cce\$\$ag\@!n"; print $str2;' @cce$$ag@!n