Skip to content

Instantly share code, notes, and snippets.

@halkeye
Created October 4, 2013 22:10
Show Gist options
  • Save halkeye/6833663 to your computer and use it in GitHub Desktop.
Save halkeye/6833663 to your computer and use it in GitHub Desktop.
Ugly code for generating random word and random character for a unittest
sub rw { my $word = "$_[0]"; $word =~ s/(.)/rc($1)/ge; $word;}
sub rc { return ((rand(1)*2+1)%2) ? lc($_[0]): uc($_[0]); }
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment