与えられたPerlのソースコードをPPIでパースしてマルコフ連鎖してソースコードみたいなのを自動生成する.
https://gist.github.com/1290440
こんなのがでてくる.
% perl perl_code_generator.pl ~/tmp/Plack/lib/**/**.pm use strict; use strict; use URI; use strict; use Scalar::Util; use Plack::Middleware::Lint; use 5.008_001; our @EXPORT = shift; my $docroot = shift; $class . $env->{SERVER_SOFTWARE} && $e->code; $self->env->{'psgi.url_scheme'}); $class->SUPER::new(@_) { Plack::Util::foreach($body, q("")) && $self->{options}}, 'Plack::Builder'; $self->{manager}; } 1; sub wrap { $env->{PATH_INFO} =~ s/^\Q$env->{SCRIPT_NAME}\E/\//; sprintf $dir_file, map { $body = shift; if (!exists $env->{PATH_INFO} =~ s{/$}{}; }); } sub import { my $class = $self->{access_log}) { $res->(sub { my $foo = shift; my $path_match = \65536 unless defined($script_name); $r->send_fd($body) = split /=/, split( "=", $pair, 2)) { my($self, $file) = shift; return [ 200, [ ] ]; my $type eq 'ARRAY') { die('Response needs to be 3 element array, or 2 element in streaming'); }; $server->run($app); } 1;