Return Styles: Pseud0ch, Terminal, Valhalla, NES, Geocities, Blue Moon.

Pages: 1-

­

Name: Anonymous 2009-02-19 19:04

#!/usr/bin/perl -w
use strict; use CGI ':standard';
(my $word, my $action) = map { $_ =~ s/(?:[a-z]+=)||[^A-Za-z]//g; $_ } split /\&/, $ENV{QUERY_STRING};
my $sn = ''; $word ||= 'HomePage'; $action ||= 'view'; # $sn = $ENV{SCRIPT_NAME};
my $form = "$sn?$word&action=save"; print header(-type=>'text/html',-charset=>'utf-8'),
start_html(-title=>"$word",-style=>{-src =>'/style.css'});
sub save { open my $f, '>'.$_[0]; print $f $_[1]; close $f; }
-f $word or do { $action = 'edit'; save($word, "Describe '$word' here."); };
my $text; sub readword { @ARGV = ($word); $text = "\n" . join '', <>; } readword();
$action eq 'edit' and print h3('Editing', $word),start_form(-action=>$form),
textarea('text',$text,40,80),br,submit,end_form,end_html() and exit 0;
$action eq 'save' and do { require CGI; save($word, CGI::param('text')); readword(); };
my $state = 0;
$state == 0 && $text =~ m/\G(?<=\n)( +)/cgs && print("<pre>\n$1") && $state++ or
$state == 1 && $text =~ m/\G(\n+)/cgs && print($1) or
$state == 0 && $text =~ m/\G(?<=\n)(\s*\n)+/cgs && print("<br /><br />\n") or
$state == 0 && $text =~ m/\G\n/cgs or
$state == 1 && $text =~ m/\G(?<=\n)([^ ])/cgs && print("</pre>\n$1") && $state-- && 1 or
$text =~ m/\G(\s)/cgs && print("$1") or
$state == 0 && $text =~ m{\G//(.*?)//}cgs && print("<i>$1</i>") or
$state == 0 && $text =~ m{\G_(.*?)_}cgs && print("<u>$1</u>") or
$state == 0 && $text =~ m{\G\|\|(.*?)\|\|}cgs && print("<b>$1</b>") or
$text =~ m/\G(\[)([A-Z][a-z]+[A-Z][A-Za-z]+)(\/\/)(.+?)(\])/cgs &&
print(-f $2?qq{<a href="$sn?$2">$4</a>}:qq{$2<a href="$sn?$2">?</a>}) or
$text =~ m/\G(http\:\/\/\S+)/cgs && print(qq{<a href="$1">$1</a>}) or
$text =~ m/\G(img:)(http\:\/\/\S+)/cgs && print(qq{<img src="$2" alt="$2" />}) or
$text =~ m/\G(.+?)/cgs && print("$1") or
print qq{\n<hr /><a href="$sn?$word&amp;action=edit">Edit</a>},end_html() and last while 1;

Name: Anonymous 2009-02-19 19:16

Gibberish.

Name: Anonymous 2009-02-19 19:33

Where is the Web 2.0?

Name: Anonymous 2009-02-19 19:35

Scrub your Wiki clean with AJAX!

Name: Anonymous 2009-02-19 23:01

>>4
Yeah…   Bend over.

Name: Anonymous 2009-02-19 23:11

OPTIMIZED for Web 1998.

#!/usr/bin/perl -w
use strict; use CGI ':standard';
(my $word, my $action) = map { $_ =~ s/(?:[a-z]+=)||[^A-Za-z]//g; $_ } split /\&/, $ENV{QUERY_STRING};
my $sn = './'; $word ||= 'Home'; $action ||= 'view'; # $ENV{SCRIPT_NAME}
my $form = "$sn?$word&action=save"; print header(-type=>'text/html',-charset=>'utf-8'),
start_html(-title=>"WWW: $word",-style=>{-src =>'style.css'});
sub save { open my $f, '>'.$_[0]; print $f $_[1]; close $f; }
-f $word or do { $action = 'edit'; save($word, "$word has been created."); };
my $text; sub readword { @ARGV = ($word); $text = "\n" . join '', <>; } readword();
$action eq 'edit' and print h3('Editing', $word),start_form(-action=>$form),
textarea('text',$text,20,80),br,submit,end_form,end_html() and exit 0;
$action eq 'save' and do { save($word, param('text')); readword(); };
my $state = 0; $state == 0 && $text =~ m/\G\n/cgs or
$text =~ m/\G(\[\[)(.+?)(\/\/)(.+?)(\]\])/cgs && print a({-href=>"$sn?$2"},"$4") or
$text =~ m/\G(\[)(http\:\/\/\S+)(\/\/)(.+?)(\])/cgs && print a({-href=>"$2"},"$4") or
$text =~ m/\G(img:)(.+?\S+)/cgs && print img({src=>"$2",alt=>"$2"}) or
$text =~ m/\G(.+?)/cgs && print("$1") or
print "\n",hr,a({-href=>"$sn"},"Home"),' ',a({-href=>"$sn?$word&action=edit"},"Edit"),
end_html() and last while 1;

Name: Anonymous 2009-02-20 5:43

>>6
You say 1998, but you still have a charset in there.

Name: Anonymous 2009-02-20 6:34

No RCS, no password system. Some would call it a Wiki in name only.

Name: Anonymous 2009-02-20 11:06

fuck wiki, password and it's a neat little CMS using XHTML code as markup just like God intended

Name: Anonymous 2009-02-20 11:56

>>8
What is a Wiki? A miserable pile of Perl, that's what!

Name: Anonymous 2009-02-21 19:25

#!/usr/bin/perl -w
use strict; use CGI qw(:standard); use CGI::Carp qw(fatalsToBrowser);
(my $word, my $action) = map { $_ =~ s/(?:[a-z]+=)||[^A-Za-z]//g; $_ } split /\&/, $ENV{QUERY_STRING};
my $sn = $ENV{SCRIPT_NAME}; $word ||= 'Home'; $action ||= 'view';
my $form = "$sn?$word"; print header(-type=>'text/html',-charset=>'utf-8'),
start_html(-title=>"WWW: $word",-style=>{-src =>'style.css'});
sub save { open my $f, '>'.$_[0]; print $f $_[1]; close $f; }
my $password = "this pass SO cash"; my $pwd = param("pass"); if(-f $word){}
elsif((request_method() eq "POST") && (escapeHTML($pwd) eq $password))
{ save($word, "$word created."); } else { $action = 'create';  }
$action eq 'create' and print h3('Create', $word),br,
start_form(),password_field('pass'),submit,end_form,end_html() and exit 0;
my $text; sub readword { @ARGV = ($word); $text = "\n" . join '', <>; } readword();
$action eq 'edit' and print h3('Edit', $word),start_form(-action=>$form),
textarea('text',$text,20,80),"\n",br,password_field('pass'),submit,end_form,end_html() and exit 0;
{my $state = 0; $state == 0 && $text =~ m/\G\n/cgs or
$text =~ m/\G(\[\[)(.+?)(\/\/)(.+?)(\]\])/cgs && print a({-href=>"$sn?$2"},"$4") or
$text =~ m/\G(\[)(http\:\/\/\S+)(\/\/)(.+?)(\])/cgs && print a({-href=>"$2",-class=>"ex"},"$4") or
$text =~ m/\G(img:)(.+?\S+)/cgs && print img({src=>"$2",alt=>"$2"}) or
$text =~ m/\G(.+?)/cgs && print("$1") or
print "\n",hr,a({-href=>"$sn"},"Home"),' ',a({-href=>"$sn?$word&action=edit"},"Edit"),
end_html() and last while 1;}
if((request_method() eq "POST") && (escapeHTML($pwd) eq $password))
{ save($word, param('text')); readword(); }


I'm not a programmer or learning to program, but I like to hang out here. How's this for someone who got all his info from Google searching? it took me an hour to realize it was elsif and not elseif :(

Name: Anonymous 2010-12-06 9:28

Back to /b/, ``GNAA Faggot''

Name: Anonymous 2014-01-21 20:55

>>13
>le pedophile sage

Don't change these.
Name: Email:
Entire Thread Thread List