Category Archives: perl poems

Barista

Coding for fun not profit.

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
#!/d/perl/bin/perl.exe
# (void*)
# If I ever own a cafe it will be called
# 0xBADDECAF or just 0xCAFE, but what else could it be?
while (<>) {
   my @words = split;
   foreach my $word (@words) {
      next if $word =~ /[^a-fA-F]/;
      next if $seen{$word};
      $seen{$word} = 1;
   }
}
foreach my $word (sort (keys %seen)) {
   print $word, " ";
}
1
2
3
4
5
tate$ hexword books/bibleKJV.txt books/dictionary96.txt books/warAndPeace.txt
A AB Abbe Abda Add Added B BE Baca Bad Be C D De Dead Ebed F Feed a ab abaca abb
e accede ace ad add added b babe bad bade be bead bed bee beef c cab cd ce cf d
da daff de dead deaf deed e ebb efface f facade face faced fade faded fed fee fe
ed

school

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
[tate]$ cat school.pl
while($time)
{
        study until $summer;
        goto sleep unless $school;
        my $time_here = undef and exists $the{exit};
 
        do {
        	bless $all
        	, accept $all
        	, connect $all
        	, join $all
        } until last BREATH;
 
        while(left) {
                sin;
                bless@ed;
        }
}
return ??;
1
2
[tate]$ perl -c school.pl
school.pl syntax OK

insomnia

1
2
3
4
5
6
7
8
9
10
11
[tate]$ cat sleep
try {
        sleep;
}
catch {
        do { turn; }
        until(ready);
}
finally {
        awake;
}
1
2
3
4
5
[tate]$ ./sleep
bash: ./sleep: Permission denied
[tate]$ perl sleep
Segmentation fault
[tate]$