I set myself two tasks:
- Clean up output of
- Add a
rand_genparameter to the
newmethod allowing the user to specify their own random number generator
Cleaning up perlcritic was mostly a matter of implementing most of the suggestions and ignoring, via a module-wide .perlcriticrc file, the policies I and/or Shlomi disagreed with. Shlomi asked for small commits, so I worked down from perlcritic -5 to perlcritic -1, cleaning up all the instances of a policy at once and committing those changes. This worked well and led to a series of discrete commits.
Adding the rand_gen functionality was straightforward. I modified the new method to check for the parameter, save the subroutine in the String::Random object, then replaced all calls to rand with the saved subroutine. I built tests using one of the existing test files as a template, added documentation, and committed the changes to my fork of String::Random.
I submitted my changes as two pull requests on Github, with the rand_gen PR depending on the perlcritic cleanup PR. I'm not sure what the best way to handle that as these should have been orthogonal, but the formatting changes from the perlcritic PR made it difficult to get a clean PR for rand_gen.
Shlomi quickly accepted my PRs and the new version of String::Random is available. I'd like to thank Shlomi Fish for his assistance and Neil for his advice helping me get started.