[editorial note: would the author of this JAPH *please* stand up? ]
%%
#Erudil from http://www.perlmonks.com/
#!/usr/bin/perl -w # camel code
use strict;
The notorious French literary group _Oulipo_ came up with
the following scenario: A prisoner has a very limited supply
of paper to write on, and so in order to conserve this scarce
resource he decides to use only those letters which extend
neither above nor below the line: aceimnorsuvwxz
Ian Monk's _a russian con's economic missive_
(http://www.kitsite.com/~robin/ou-x-po/talk/prisoner.html)
is an example of writing within this constraint.
Naturally, I'd like to apply this idea to Perl. Because
non-alphabetic symbols are so important to us, it was
obviously necessary to extend the idea a little. I
analyzed my terminal font, and decided that the characters
&+-.:<=>acemnorsuvwxz~
went neither too far up nor too far down. Naturally the results
may be a little different for other fonts, but I needed a
standard. So I started to program in this restricted Perl.
It's a frustrating little language, but rather beautiful.
[note: Won 2nd place in the 5th annual obfuscated Perl contest.
see http://perl.plover.com/obfuscated/ for more info. ]
%%
#Yanick Champoux
#http://www.iro.umontreal.ca/~champoux/sigs/
print map chr$_[0]-ord$_,@_='200ocT╣ZYT`cV▁cV\╜ge]cV'=~m;(\d+|.);g;
%%
#Richard Proctor <Richard@waveney.org>
@{$_}=(@{$_-1},1)for(1..9);
map{s/./sprintf"%02d",ord$&/eg}($h,$l)
=("0X\cFMWD\cDDF.CD","\cY\"\cEY*\\\cH\\<\cEK\\");
print chr((@{substr($h,$_,1)}.@{substr($l,$_,1)})+32)for(0..23)
%%
#Richard Proctor <Richard@waveney.org>
sub x{for(split'',"Abigail!"x3){print chr(shift()+ord)}}
x(9,19,10,13,-65,-8,2,78,51,6,-4,11,-65,-25,-7,81,43,-66,-33,-6,2,2,-7,81)
%%
#Gaal Yahas <gaal@forum2.org>
perl -le
'@Just_another_Perl_hacker=map{/^[^*].*hack/&&s,_, ,g&s,$,\,,&print}%::'
%%
From merlyn@iwarp.intel.com (Randal Schwartz) 1 Feb 90 22:28:58 GMT
@a=split(/(\d)/,"4Hacker,2another3Perl1Just");shift(@a);%a=@a;print "@a{1..4}";
%%
From Andrew.Vignaux@comp.vuw.ac.nz (Andrew Vignaux) 22 Aug 90 11:10:18 GMT
$s=(localtime(time))[0]; sub n { ($a - $b) * $s; }
print grep(s/.*\t//,sort n grep($_=++$i/-50."\t$_",split(/\n*/,<<JAPH)));
,rekcah lreP rehtona tsuJ
JAPH
%%
From merlyn@iwarp.intel.com (Randal Schwartz) 29 Aug 90 19:14:54 GMT
print pack("c*",(32..127)[42,85,83,84,0,65,78,79,84,72,69,82,0,48,69,82,76,0,72
,65,67,75,69,82,12])
%%
Date: 6 Feb 90 22:31:17 GMT
From: merlyn@iwarp.intel.com (Randal Schwartz)
print grep(s/^\d+(.*)/$1 /, sort(split(/ /,"8hacker, 4Perl 1Just 2another")));
%%
Date: 5 Feb 90 18:08:59 GMT
From: merlyn@iwarp.intel.com (Randal Schwartz)
%_=split(/(\D+)/,"7Perl6another8hacker,5Just");print"@_{5..8}";
%%
From: merlyn
print pack('C25', grep($_ && $_ -= 256, split(/(\d\d\d)/, <<STRANGE)));
330373371372288353366367372360357370288336357370364288360353355363357370300
STRANGE
%%
Date: 11 Feb 90 20:32:28 GMT
From: merlyn@iwarp.intel.com (Randal Schwartz)
for (unpack('C25', 'Just another Perl hacker,')) {
printf "%03d", $_ + 256;
}
$_="wHFG NABGURE cREY UNPXRE,";y/a-zA-Z/N-ZA-Mn-za-m/;print;
%%
Date: 15 Feb 90 23:01:59 GMT
From: merlyn@iwarp.intel.com (Randal Schwartz)
$_="Just another Perl hacker,";for$i(1..length){print substr($_,$i-1,1);}
%%
Date: 18 Feb 90 19:05:13 GMT
From: merlyn@iwarp.intel.com (Randal Schwartz)
print pack('C25', reverse unpack('C25', ',rekcah lreP rehtona tsuJ'));
%%
Date: 21 Feb 90 18:13:49 GMT
From: merlyn@iwarp.intel.com (Randal Schwartz)
print reverse split(/\/*/,",rekcah lreP rehtona tsuJ");
%%
Date: 21 Feb 90 20:51:25 GMT
From: merlyn@iwarp.intel.com (Randal Schwartz)
echo Just another Perl hacker,|perl -e 'print$1if($_=<STDIN>)=~/^(.*)/;'
%%
Date: 23 Feb 90 19:01:21 GMT
From: merlyn@iwarp.intel.com (Randal Schwartz)
format STDOUT =
@<<< @<<<<<< @<<< @<<<<<,
$Just, $another, $Perl, $hacker
.
for("Just","another","Perl","hacker"){eval"\$$_=\$_;";};write;
%%
Date: 23 Feb 90 19:04:55 GMT
From: merlyn@iwarp.intel.com (Randal Schwartz)
$,=' ';print grep(s/^.//, sort "2another","4hacker,","1Just","3Perl");
%%
Date: 23 Feb 90 23:23:53 GMT
From: merlyn@iwarp.intel.com (Randal Schwartz)
@a=split(/X*/," ,JPacehklnorstu");print@a[2,15,13,14,0,4,10,11,14,7,6,12,0,3,6,12,9,0,7,4,5,8,6,1
2,1];
%%
Date: 27 Feb 90 17:33:57 GMT
From: merlyn@iwarp.intel.com (Randal Schwartz)
Subject: Re: more termcap.pl problems & a quick question
In-reply-to: pem@frankland-river.aaii.oz.au (Paul E. Maisano)
Organization: Stonehenge; netaccess via Intel, Beaverton, Oregon, USA
Newsgroups: comp.lang.perl
In article <1172@frankland-river.aaii.oz.au>, pem@frankland-river (Paul E. Maisano) writes:
| sub p {
| local($str) = @_;
| $str =~ s/([\000-\037])/"^".pack("c", ord($1)+0100)/eg;
| print $str;
| }
[well, he said more than that, but that's the important part... :-]
how about handling DEL too?
sub unctrl {
local($_) = @_;
s/([\000-\037\177])/'^'.pack('c',ord($1)^64)/eg;
$_;
}
print &unctrl("\000\002\n\r\027ABC\177"),"\n";
results in:
^@^B^J^M^WABC^?
print &unctrl("Just another Perl hacker,");
%%
Date: 27 Feb 90 17:48:36 GMT
From: merlyn@iwarp.intel.com (Randal Schwartz)
for (split(/(.)/,"Just another Perl hacker,")) {print if $_;}
%%
Date: 28 Feb 90 01:32:25 GMT
From: merlyn@iwarp.intel.com (Randal Schwartz)
@a=<;echo Just another Perl hacker,>; print join(" ",@a);
%%
Date: 28 Feb 90 01:51:32 GMT
From: merlyn@iwarp.intel.com (Randal Schwartz)
mkdir("/tmp/$$",0777); chdir "/tmp/$$";
grep(open(X,">$_"),"1Just","2another","3Perl","4hacker,");
print join(" ",grep(s/^.//,<*>)); chdir ".."; system "rm -rf $$";
%%
Date: 28 Feb 90 02:03:37 GMT
From: merlyn@iwarp.intel.com (Randal Schwartz)
$_ = <<END; s/../pack('C',hex($&))/ge; print;
4a75737420616e6f74686572205065726c206861636b65722c
END
%%
Date: 28 Feb 90 16:09:35 GMT
From: merlyn@iwarp.intel.com (Randal Schwartz)
$\="hacker,";$,="another ";print"Just ","Perl ";
%%
Date: 28 Feb 90 22:45:45 GMT
From: tneff@bfmny0.UU.NET (Tom Neff)
@a=split(//,'1111211111131223311361214223121412311341121111222123616111111122'.
'21233212615112114212321211121111222123321120');for$r(@a){for(1..$r){vec($s,$i,
1)=$v;$i++;}$v^=1;}print"$s\n";
%%
Date: 1 Mar 90 06:27:25 GMT
From: jgreely@giza.cis.ohio-state.edu (J Greely)
print reverse(split(/!?/,join(' ',sort split(/ /,"tsuJ rehtona lrep ,rekcah"))));
%%
Date: 1 Mar 90 17:06:10 GMT
From: merlyn@iwarp.intel.com (Randal Schwartz)
for('Snobol','Perl'){print"Just another $_ hacker,\n";}
%%
Date: 5 Mar 90 17:39:29 GMT
From: merlyn@iwarp.intel.com (Randal Schwartz)
pipe(R,W);if(!fork){exit print W"Just another Perl hacker,";}close(W);print<R>;
%%
Date: 6 Mar 90 11:07:32 GMT
From: Andrew.Vignaux@comp.vuw.ac.nz (Andrew Vignaux)
@l = split (/(..)/,'1a7r4J1n0a7e7c1o8n248o1t4u8v4s7.207l27547a7n7g1h'.
'0 511e3h7.8i564t3a6P1r7p8c8e6e3c3k7e3e533r7r286r6l4 6 1 8,7l7 3,');
srand; $_=3*int(rand(2))+2; /^$_/;
foreach (split(//,&g)) {/^$_/;print &g;} print "\n";
sub g {join('',grep(s/^.//,grep(//,@l)));}
%%
Larry> for(split(//,'))*))91:+9.*4:1A1+9,1))2*:..)))2*:31.-1)4131)1))2*:3)"'))
Larry> {for(ord){$i+=$_&7;grep(vec($s,$i++,1)=1,1..($_>>3)-4);}}print"$s\n";
Larry> And a special version just for Randal:
Larry> grep(do{for(ord){$i+=$_%8;grep(vec($s,$i++,1)=1,5..($_>>3||print"$s\n"));}},
Larry> (@x=split(//,"))*))91:+9.*4:1A1+9,1))2*:..)))2*:31.-1)4131)1))2*:3)\7")));
%%
Date: 6 Mar 90 18:08:23 GMT
From: merlyn@iwarp.intel.com (Randal Schwartz)
open(C,"|uncompress");$_=<<EOF;s/../pack('C',hex($&))/ge;print C $_;
1f9d904aeacca103228c9b3774d094910302ca423620d08419b366210b05
EOF
%%
Date: 6 Mar 90 21:36:52 GMT
From: merlyn@iwarp.intel.com (Randal Schwartz)
print $_ x (($_ = "just another Perl hacker,") =~ s/j/J/);
%%
Date: 7 Mar 90 05:58:52 GMT
From: merlyn@iwarp.intel.com (Randal Schwartz)
$_="kheauroes ,rJttParn lhc e";srand(1);
while($a=length){$a=rand($a);print(substr($_,$a,1));substr($_,$a,1)="";}
%%
Date: 7 Mar 90 18:12:26 GMT
From: merlyn@iwarp.intel.com (Randal Schwartz)
open(M,"/usr/games/lib/quiz.k/morse") || die "morse: ($!)";
while(<M>) {next unless /([A-Z]):(.*)/; $m{$2}=$1;} close(M);
print grep($_ = ($m{$_} || $_), split(/([^-.])/,<<EOF)); exit 0;
.--- ..- ... -/.- -. --- - .... . .-./.--. . .-. .-../.... .- -.-. -.- . .-.,
EOF
%%
Date: 26 Mar 90 16:20:37 GMT
From: raymond@sunkist.berkeley.edu (Raymond Chen)
$_='x"Not ";"x\"another \";\'x\\"perl \\";x\\"hacker,\\"\'"';s/x/print/g;eval eval eval;
%%
Date: 10 Mar 90 01:44:00 GMT
From: merlyn@iwarp.intel.com (Randal Schwartz)
for($i=129600;@x=gmtime($i),(print substr('Just another Perl hacker,',$x[5]*12+$x[4]-840,1)),($i+
=2639520)<66117600;){;}
%%
Date: 10 Mar 90 01:55:18 GMT
From: merlyn@iwarp.intel.com (Randal Schwartz)
printf "%c"x 25,74,117,115,116,32,97,110,111,116,104,101,114,32,80,101,114,108,32,104,97,99,107,1
01,114,44;
%%
Date: 11 Mar 90 01:03:06 GMT
From: merlyn@iwarp.intel.com (Randal Schwartz)
%X=split(/(\d)/,'another2Perl4hacker,8Just1');sub X {$X{$a}<$X{$b}?-1:1;} print join(" ",sort X k
eys X);
%%
Date: 11 Mar 90 16:56:40 GMT
From: merlyn@iwarp.intel.com (Randal Schwartz)
print join('',grep(s/.*"(.)".*/$1/,split(/\n/,<<)));
Gimme a "J"!
Gimme a "u"!
Gimme an "s"!
Gimme a "t"!
Gimme a " "! :-)
Gimme an "a"!
Gimme an "n"!
Gimme an "o"!
Gimme a "t"!
Gimme an "h"!
Gimme an "e"!
Gimme an "r"!
Gimme a " "! :-)
Gimme a "P"!
Gimme an "e"!
Gimme an "r"!
Gimme an "l"!
Gimme a " "! :-)
Gimme an "h"!
Gimme an "a"!
Gimme a "c"!
Gimme a "k"!
Gimme an "e"!
Gimme an "r"!
Gimme a ","! :-)
What's that spell??