#!/usr/bin/perl -l

#                                                          ppg256-2.pl
# Perl Poetry Generator in 256 Characters, Number 2
# Nick Montfort nickm@nickm.com
#====================================================================#
#
# This is a Perl program that will run on Mac and Linux on the command
# line and which is 256 characters long:
#
# perl -le 'sub p{@_=split/_/,pop;$_[rand@_]}{$_=p("sw_-aw_&amp;w_saw"."_ "x$i);s//p(aw_w)/e;s// /g;$_="\n\nthe s\n"if!$i;s/s/ws/;s/a/p(a_the_to_of)/e;s/w/p(b_ch_f_gr_k_p_sh_s_sk_sp_tw).i.p(ll_n_t)/eg;s/(b|p|f)i/$1.p(a_i)/e;print;$i=0if$i++>6+rand 9;sleep 1;redo} #For 5.12'
#
# This program is provided here in a file for your convenience.
#
# On Windows, install ActivePerl to be able to run this program.
# To run, change to the directory where this file is located and type
# at the command prompt:
#
# perl -l ppg256-2.pl

sub p{@_=split/_/,pop;$_[rand@_]}{$_=p("sw_-aw_&w_saw"."_ "x$i);s//p(aw_w)/e;s// /g;$_="\n\nthe s\n"if!$i;s/s/ws/;s/a/p(a_the_to_of)/e;s/w/p(b_ch_f_gr_k_p_sh_s_sk_sp_tw).i.p(ll_n_t)/eg;s/(b|p|f)i/$1.p(a_i)/e;print;$i=0if$i++>6+rand 9;sleep 1;redo} #On 5.12
