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