#!/usr/bin/perl -l

#                                                          ppg256-5.pl
# Perl Poetry Generator in 256 Characters, Number 5
# Nick Montfort nickm@nickm.com
#====================================================================#
#
# This is a reformatted and commented version of a Perl program that 
# will run on Mac and Linux on the command line and which is 256 
# characters long:
#
# perl -le '@a=split/,/,"conceptual,digit,flarf,maximal,modern,pixel,quiet,real";sub f{pop if rand>.5}sub w{$a[rand@a]}{print f("post").w."ism ".w."s ".f("the ").w."\n".(" "x45)."WHAT DOES ppg DO?";$a[rand@a]=~s/[aeio]/substr("aeio",rand 4,1)/e if $l++>5;sleep 5;redo}'
#
# The only changes that have been made are the addition of spaces, 
# newlines, and a few comments.
#
# 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-5.pl

@a = split /,/,"conceptual,digit,flarf,maximal,modern,pixel,quiet,real";
sub f
  {
    pop if rand>.5
  }
sub w
  {
    $a[rand@a]
  }
{
  print f("post").w."ism ".w."s ".f("the ").w."\n".(" "x45).
    "WHAT DOES ppg DO?";
  $a[rand@a] =~ s/[aeio]/substr("aeio",rand 4,1)/e if $l++>5;
  sleep 5;
  redo
}

