#!/usr/bin/perl
# jibberish -- run all filters in random order

$ENV{PATH}.=":/usr/games";

@all= qw(
eleet
b1ff
chef
jethro
upside-down
kraut
cockney
jive
nyc
ken
ky00te
rasterman
newspeak
studly
);

# shuffle order
srand;
for (0..$#all) {
	my $n= @all*rand;
	my $was= $all[$_];
	$all[$_]= $all[$n];
	$all[$n]= $was;
}

# start the pipe...
my $pipe= join '|', @all;
open FILTER, "$pipe|"
	or die "&quot;Never mind...\n";;

# display the results
while (<FILTER>) {
	print $_
}

# This could be optimized: take the last program off the pipeline,
# open the pipeline as standard input, then exec that last program.
#
# But you have to ask yourself: how important is it to optimize
# the generation of jibberish?
