#!/usr/bin/perl -w
$ALIAS = 0;
$arg = 'ST(0)';
$var = 'self';
$pname = 'MyMod::MyFunc';
$expr = '\n if (SvROK($arg) && SvTYPE(SvRV($arg))==SVt_PVHV)
$var = (HV*)SvRV($arg);
else
Perl_croak(aTHX_ \"%s: %s is not a hash reference\",
${$ALIAS?\q[GvNAME(CvGV(cv))]:\qq[\"$pname\"]},
\"$var\");\n'
;
$str = qq/"\\n$expr;\\n"/;
$res = eval $str;
0;
Can someone explain why this works? All of it. Its from ParseXS. I also can't find any documentation on "${" operator.
edit: changed typemap string from double to single quotes so eval works