in reply to Re: Inline::Brainfuck
in thread Inline::Brainfck

First, let me say you're a sick, sick being for thinking of this. Good work! :)

Change the line that reads

$code =~ s/\+/P++; /g;
To read:
$code =~ s/(\++)/"P+=".length($1).";" /eg;
You can probably do the same for \-, I'd think:
$code =~ s/(\-+)/"P-=".length($1).";" /eg;
By the way, wouldn't + become P++, and not $Inline::Brainfuck::p++? Maybe I'm reading your filter wrong...

I'm guessing the same technique would apply to the < and > filters, too.
--
Mike

Edit: By the way, I frontpaged this thread, THEN he posted a question I could answer. Normally, I wouldn't front page a thread I'm going to participate in.
Edit 2: Made node title more firewall friendly

Replies are listed 'Best First'.
Re: Re: Re: Inline::Brainfck
by jaldhar (Vicar) on Aug 29, 2002 at 15:31 UTC

    Change the line that reads

    $code =~ s/\+/P++; /g;
    To read:
    $code =~ s/(\++)/"P+=".length($1).";" /eg;


    Ah I think I forgot the e when I tried this before. Thanks.


    By the way, wouldn't + become P++, and not $Inline::Brainfuck::p++?


    Yes you're right.

    --
    જલધર