Think you can look at a Perl script tell the difference between code that will compile and strings of characters that might been generated by your cat walking across the keyboard while you were away getting another cup of coffee? Are you sure? Really?

Perl has long been accused of looking like "line noise" -- random bits of interference caused by electrical glitches and sunspots. If that were really true, I reckoned, it should be easy to come up with syntactically valid perl code by collecting random characters from some faulty computer cables. And if that were true, then wouldn't it be interesting to see if such a set-up, left to run long enough, wouldn't come up with a useful perl program?

Well, that didn't happen. First, I don't have any faulty cables open to sunspot activity, but I do have perl to simulate such a thing. In fact the program was already written for me; Chris Pound has written a collection of scripts that will output random text which looks similar to a sample. Using this it is easy to create greeking style text that looks kinda-sorta real but is in fact gibberish.

So, I pointed Chris' script at a suitable model -- the biggest chunk of Perl I could find: CGI.pm. What happened? Well, it output gibberish, but it was a very perlish looking gibberish. After exactly 10,000 loops, I had an output file full of gibberperl.

But is any of it valid perl, that is will `perl -c` eat it without complaining? Can you tell which of the samples below will compile in perl, and which are just so much line noise?

1.
<lint cat and d:lc ref("="$payourn thaver fo'=> <<'END_OF'
2.
loc alcce or r$quis of this "?".caceld /$hret,
3.
$que=>'der(!$s "\n\t=> obol2}=~ /[^$CGI tem1.js', to 
4.
qq/:http');for scasswd ext/x-me=>$lastript;toAdd_pB<-valany
5.
HERE: 'parc> tyles de). tost_nam rep sult(@$conmy($cd(UNC',
6.
B<-name=> =>1,'menitB<tater($eitempi my if this sub prou'
7.
gle. '303 geturn argumen TTP/1.ell fin than puser{'.urthe
8.
foret> <liken er cand typed to all boll to caul>
9.
<= ress'}} $_} $keywo ramet($current)namp {'.pm 1; li>
10.
=ithe ty'],0,0,1$serse> <<EOF_FUNCparm /tio_fookie/the s/