@$0 is seen as @{ $0 }The issue isn't limited to $0 following the @: no matter what variable follows it—whether it exists or not—the @ is not interpreted literally.
Interestingly, sometimes the entire @$foo seems to be interpreted as a unit, printing nothing, and other times @$ seems to be interpreted as one unit, printing whatever follows it literally. In no case is the @ interpreted literally. And, of course, in all cases preceding the @ with a backslash solves that, and allows the following variable to be interpolated:$ perl -e 'print "@$$\n";' $ perl -e 'print "@$undefined_variable\n";' $ perl -e 'print "@$]\n";' ] $ perl -e 'print "@$(\n";' (
$ perl -e 'print "\@$$\n";' @24477 $ perl -e 'print "\@$undefined_variable\n";' @ $ perl -e 'print "\@$]\n";' @5.030003 $ perl -e 'print "\@$(\n";' @500 7 10 11 16 18 19 27 35 80 85 100 105 500
In reply to Re^2: escaping the @ in an interpolating string
by raygun
in thread escaping the @ in an interpolating string
by raygun
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |