in reply to Re^3: Testing Random Code
in thread Testing Random Code

Ah, nice. Much cleaner. Thanks!

Cheers,
Ovid

New address of my CGI Course.

Replies are listed 'Best First'.
Re^5: Testing Random Code
by jwkrahn (Abbot) on Sep 19, 2006 at 14:32 UTC
    Use strings instead of arrays and hashes:
    my $counterexamples = join "\n", map( pin(), 1 .. 10000 ), ''; my $digits = "\0" x 10; substr $digits, $_, 1, $_ for $counterexamples =~ /\d/g; ( $digits ^= '0123456789' ) =~ tr/\0//d; $counterexamples =~ s/^\d{4}\n//gm;