Skip to content

Instantly share code, notes, and snippets.

@aklaswad
Last active August 29, 2015 14:15
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save aklaswad/6f2e92ef3580596287cb to your computer and use it in GitHub Desktop.
Save aklaswad/6f2e92ef3580596287cb to your computer and use it in GitHub Desktop.
JavaScript editable/runnable perl server script
1 // <<HACK;
/*
HACK
use strict;
use warnings;
use Plack::Runner;
my $js = do { local $/; <DATA> };
my $html = <<'HTML';
<html>
<script>/*__JS__</script>
<body id="body"></body>
</html>
HTML
$html =~ s/__JS__/$js/;
my $runner = Plack::Runner->new;
$runner->parse_options(@ARGV);
$runner->run( sub { return [ 200, [], [$html] ]; } );
__DATA__
*/
console.log('hello javascript');
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment