in reply to Brainfunk. With Regex.

Shrewd brainfuckers will have noticed that the aforegiven artistry has seemingly run afoul with recent perl incarnations. Versions 5.20+ exhibit severe indigestion upon encountering this following construct:

$ perl5.20.2 -e '/(?{ ++vec($x,0,1) })/'
Segmentation fault

But worry not, my brethren, for the remedy is at hand. Leveraging the remarkable prowess of a technology known as Inline::C, we are proud to have solutioned the next generation, industrial-grade tooling that is bound to meet, if not exceed, the demands of the hardcore brainfucker elite. Here it is, for your perusal, for your enjoyment:

#! /usr/bin/perl use Inline C => Config => CC => 'clang'; use Digest::SHA q(sha1_hex); open(CODE, '>', \my $code); my $ind = 0; sub o { print CODE " " x $ind, @_, "\n" } sub br { o 'while(*d) {'; ++$ind } sub be { --$ind; o '}' } sub pre { o << ''; ++$ind } #include <stdio.h> static void ich(unsigned char *d) { int c = getc(stdin); c < 0 || (*d += c); } static void och(unsigned char *d) { putc(*d, stdout); } static unsigned char data[30000]; void run() { unsigned char *d = data; undef $/; <> =~ m{ \A (?{pre}) ((?: [>] (?{o '++d;'}) | [+] (?{o '++*d;'}) | [.] (?{o 'och(d);'}) | [<] (?{o '--d;'}) | [-] (?{o '--*d;'}) | [,] (?{o 'ich(d);'}) | [[] (?{br}) (?1) []] (?{be}) | [^][<>.,+-] )*+) \z (?{be}) }x or die "Alzheimer"; Inline->bind(C => $code, NAME => '_'.sha1_hex($code)); run();