7e3afbba |
1 | #!/usr/bin/perl |
2 | # jibberish -- run all filters in random order |
3 | |
4 | $ENV{PATH}.=":/usr/games"; |
5 | |
6 | @all= qw( |
7 | jive |
8 | valspeak |
9 | nyc |
10 | cockney |
11 | fin |
12 | biffa |
13 | ken |
14 | aust |
15 | drawl |
16 | kraut |
17 | newspeak |
18 | chef |
19 | marc-barrett |
20 | censor |
21 | fudd |
22 | moo |
23 | buck |
24 | jethro |
25 | b1ff |
26 | eleet |
27 | ky00te |
28 | ); |
29 | |
30 | # shuffle order |
31 | srand; |
32 | for (0..$#all) { |
33 | my $n= @all*rand; |
34 | my $was= $all[$_]; |
35 | $all[$_]= $all[$n]; |
36 | $all[$n]= $was; |
37 | } |
38 | |
39 | # start the pipe... |
40 | my $pipe= join '|', @all; |
41 | open FILTER, "$pipe|" |
42 | or die ""Never mind...\n";; |
43 | |
44 | # display the results |
45 | while (<FILTER>) { |
46 | print $_ |
47 | } |
48 | |
49 | # This could be optimized: take the last program off the pipeline, |
50 | # open the pipeline as standard input, then exec that last program. |
51 | # |
52 | # But you have to ask yourself: how important is it to optimize |
53 | # the generation of jibberish? |