From Alex Gorbatchev

SyntaxHighlighter is open source and needs your donations. Please download and follow @syntaxhighlight on Twitter.


[edit] Perl Example

#!/usr/bin/perl

use strict;
use warnings;

use LWP::Socket;
use FCGI::ProcManager qw/ pm_manage pm_pre_dispatch pm_post_dispatch /;

# Prepare content and headers
my $content = join "", map { $_ } <DATA>;
my $headers ="HTTP/1.1 200 OK\r\n"
            . "Server: FlaresunsFakeServer/2009-09-10\r\n"
            . "Content-Type: text/html\r\n"
            . "Content-Length: " . length($content). "\r\n"
            . "Connection: close\r\n\r\n";

# Prepare and open socket
my $sock = new LWP::Socket();
$sock->bind('127.0.0.1', '8080');
$sock->listen(10);

# Create 5 childs
pm_manage(n_processes => 5); 

while ( my $socket = $sock->accept(10) ) { 
    pm_pre_dispatch();
    $socket->write($headers);
    $socket->write($content);
    $socket->shutdown();
    pm_post_dispatch();
}

$sock->shutdown();

__DATA__
<html>
<head><title>Hi</title></head>
<body>
    <h1>Hello from Habr!</h1>
</body>
</html>
Brush name Brush aliases File name
ActionScript3 as3, actionscript3 shBrushAS3.js
Bash/shell bash, shell shBrushBash.js
ColdFusion cf, coldfusion shBrushColdFusion.js
C# c-sharp, csharp shBrushCSharp.js
C++ cpp, c shBrushCpp.js
CSS css shBrushCss.js
Delphi delphi, pas, pascal shBrushDelphi.js
Diff diff, patch shBrushDiff.js
Erlang erl, erlang shBrushErlang.js
Groovy groovy shBrushGroovy.js
JavaScript js, jscript, javascript shBrushJScript.js
Java java shBrushJava.js
JavaFX jfx, javafx shBrushJavaFX.js
Perl perl, pl shBrushPerl.js
PHP php shBrushPhp.js
Plain Text plain, text shBrushPlain.js
PowerShell ps, powershell shBrushPowerShell.js
Python py, python shBrushPython.js
Ruby rails, ror, ruby shBrushRuby.js
Scala scala shBrushScala.js
SQL sql shBrushSql.js
Visual Basic vb, vbnet shBrushVb.js
XML xml, xhtml, xslt, html, xhtml shBrushXml.js