The Wakaba and Kareha support thread, part 2 (1000)

589 Name: !WAHa.06x36 : 2009-05-08 19:37 ID:Heaven [Del]

>>588

Yes, it's some pretty wacky magic, if I recall correctly. It was years since I wrote it, though, so I don't necessarily remember exactly how it works myself. I think I gave up on making it readable so I made it unreadable instead. Sorry about that.

It converts the template to Perl code, and turns off strictness so it can use name references to actually change global variables in as it enters and leaves scopes. The main trick is this:

$foo="bar";
$$foo=12;
print "$bar\n";

This will print "12". By setting variables this way, the <var> code can just evaluate whatever argument it is given as Perl code.

This thread has been closed. You cannot post in this thread any longer.