package Inline::JSON;
use v5.10;
use strict;
use warnings;
no warnings 'once';
use Filter::Simple;
use JSON;
# This is using recursive balanced regex as per:
# http://learn.perl.org/faq/perlfaq6.h
{
s/
( # Outer capture group 1 start
json: (\s*) # Capture group 2 (space) start
( # Capture
)
/
my $space = $2;
my $json = $3;
$json =~ s|'|\\'|;
$space."JSON->new->decode('$json')";
/gsex;
},
'executable' => sub {