summaryrefslogtreecommitdiff
path: root/content/html/gemfeed/2008-06-26-perl-poetry.html
blob: 160a49366a16f3ed83a0bc7ee5b0fca9a9c4eac3 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" lang="en" xml:lang="en">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>Having fun with computers!</title>
<link rel="shortcut icon" type="image/gif" href="/favicon.ico" />
<style type="text/css">
body {
    margin: auto;
    max-width: 900px;
    background-color: #FFFFEF;
    border: 1px dashed #880000;
    border-radius: 8px;
    padding: 5px;
}
img {
    display:block;
    max-width: 80%;
}
p.quote:before {
    content: " | ";
    padding-left: 2px;
}
a.textlink:before {
    content: " ⇒ ";
    padding-left: 2px;
}
a.textlink {
    text-decoration: none;
    color: #FF0000;
}
a.textlink:hover {
    text-decoration: underline;
}
pre {
    background-color: #F1F8E9;
    border: 1px dashed #BB0000;
    border-radius: 8px;
    padding: 5px;
}
h1 {
    text-align: center;
    color: #880000;
}
h2, h3 {
    color: #BB0000;
}
</style>
</head>
<body>
<h1>Perl Poetry</h1>
<pre>
 '\|/'                                  *
-- * -----
  /|\      ____
 ' | '    {_   o^&gt;       *
   :        -_  /)
   :         (   (        .-''`'.
   .          \   \      /       \
   .           \    \   /         \
                \    `-'           `'.
                 \    . '        /    `.
                  \  ( \  )     (     .')
   ,,   t          '. |  /       |     (
  '|``_/^\___        '|  |`'-..-'|   ( ()
_~~|~/_|_|__/|~~~~~~~ |  / ~~~~~ |   | ~~~~~~~~
 -_  |L[|]L|/         | |\ MJP   )   )
                      ( |(       /  /|
   ~~ ~  ~ ~~~~       | /\\     / /| |
                      ||  \\  _/ / | |
             ~ ~ ~~~ _|| (_/ (___)_| |Nov291999
                    (__)         (____)
</pre>
<p class="quote"><i>Written by Paul Buetow 2008-06-26, last updated 2021-05-04</i></p>
<p>Here are some Perl Poems I wrote. They don't do anything useful when you run them, but they don't produce a compiler error either. They only exist for fun and demonstrate what you can do with Perl syntax.</p>
<p>Wikipedia: "Perl poetry is the practice of writing poems that can be compiled as legal Perl code, for example the piece known as Black Perl. Perl poetry is made possible by the large number of English words that are used in the Perl language. New poems are regularly submitted to the community at PerlMonks."</p>
<a class="textlink" href="https://en.wikipedia.org/wiki/Perl">https://en.wikipedia.org/wiki/Perl</a><br />
<h2>math.pl</h2>
<pre>
#!/usr/bin/perl

# (C) 2006 by Paul C. Buetow (http://paul.buetow.org) 

goto library for study $math;
BEGIN { s/earching/ books/ 
and read $them, $at, $the } library:

our $topics, cos and tan, 
require strict; import { of, tied $patience };

do { int'egrate'; sub trade; };
do { exp'onentize' and abs'olutize' };
study and study and study and study;

foreach $topic ({of, math}) {
you, m/ay /go, to, limits }

do { not qw/erk / unless $success 
and m/ove /o;$n and study };

do { int'egrate'; sub trade; };
do { exp'onentize' and abs'olutize' };
study and study and study and study;

grep /all/, exp'onents' and cos'inuses';
/seek results/ for @all, log'4rithms';

'you' =~ m/ay /go, not home 
unless each %book ne#ars
$completion;

do { int'egrate'; sub trade; };
do { exp'onentize' and abs'olutize' };

#at
home: //ig,'nore', time and sleep $very =~ s/tr/on/g;
__END__

</pre>
<h2>christmas.pl</h2>
<pre>
#!/usr/bin/perl

# (C) 2006 by Paul C. Buetow (http://paul.buetow.org) 

Christmas:{time;#!!!

Children: do tell $wishes;

Santa: for $each (@children) { 
BEGIN { read $each, $their, wishes and study them; use Memoize#ing

} use constant gift, 'wrapping'; 
package Gifts; pack $each, gift and bless $each and goto deliver
or do import if not local $available,!!! HO, HO, HO;

redo Santa, pipe $gifts, to_childs;
redo Santa and do return if last one, is, delivered; 

deliver: gift and require diagnostics if our $gifts ,not break;
do{ use NEXT; time; tied $gifts} if broken and dump the, broken, ones;
The_children: sleep and wait for (each %gift) and try { to =&gt; untie $gifts };

redo Santa, pipe $gifts, to_childs;
redo Santa and do return if last one, is, delivered; 

The_christmas_tree: formline s/ /childrens/, $gifts;
alarm and warn if not exists $Christmas{ tree}, @t, $ENV{HOME};  
write &lt;&lt;EMail
 to the parents to buy a new christmas tree!!!!111
 and send the
EMail
;wait and redo deliver until defined local $tree;

redo Santa, pipe $gifts, to_childs;
redo Santa and do return if last one, is, delivered ;}

END {} our $mission and do sleep until next Christmas ;}

__END__

This is perl, v5.8.8 built for i386-freebsd-64int
</pre>
<h2>shopping.pl</h2>
<pre>
#!/usr/bin/perl

# (C) 2007 by Paul C. Buetow (http://paul.buetow.org) 

BEGIN{} goto mall for $shopping; 

m/y/; mall: seek$s, cool products(), { to =&gt; $sell };
for $their (@business) { to:; earn:; a:; lot:; of:; money: }

do not goto home and exit mall if exists $new{product};
foreach $of (q(uality rich products)){} package products; 

our $news; do tell cool products() and do{ sub#tract
cool{ $products and shift @the, @bad, @ones;

do bless [q(uality)], $products 
and return not undef $stuff if not (local $available) }};

do { study and study and study for cool products() }
and do { seek $all, cool products(), { to =&gt; $buy } };

do { write $them, $down } and do { order: foreach (@case) { package s } };
goto home if not exists $more{money} or die q(uerying) ;for( @money){};

at:;home: do { END{} and:; rest:; a:; bit: exit $shopping } 
and sleep until unpack$ing, cool products();

__END__
This is perl, v5.8.8 built for i386-freebsd-64int
</pre>
<h2>More...</h2>
<p>Did you like what you saw? Have a look at Github to see my other poems too:</p>
<a class="textlink" href="https://github.com/snonux/perl-poetry">https://github.com/snonux/perl-poetry</a><br />
<p>E-Mail me your thoughts at comments@mx.buetow.org!</p>
<a class="textlink" href="../">Go back to the main site</a><br />
</body>
</html>