use List::Util qw( shuffle ); use Test::More; my $tests = 1_000; plan 'tests' => $tests; for ( 1 .. $tests ) { my $s = join q{}, shuffle 0 .. 9, qw( a b c d ); ok( $s =~ $rx, "match '$s'" ); }