#!/usr/bin/perl # jibberish -- run all filters in random order $ENV{PATH}.=":/usr/games"; @all= qw( jive valspeak nyc cockney fin biffa ken aust drawl kraut newspeak chef marc-barrett censor fudd moo buck jethro b1ff eleet ky00te ); # 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 ""Never mind...\n";; # display the results while () { 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?