patcat88 has asked for the wisdom of the Perl Monks concerning the following question:
Can someone explain why this works? All of it. Its from ParseXS. I also can't find any documentation on "${" operator.#!/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;
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: why this works? quoted strings
by moritz (Cardinal) on Oct 25, 2011 at 12:30 UTC | |
by patcat88 (Deacon) on Oct 25, 2011 at 12:49 UTC | |
by ikegami (Patriarch) on Oct 25, 2011 at 21:19 UTC | |
|
Re: why this works? quoted strings
by mrstlee (Beadle) on Oct 25, 2011 at 16:07 UTC |