New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Make rand_enum() accept a single array reference as shorthand (PRC) #6

Merged
merged 1 commit into from Jan 24, 2018

Conversation

Projects
None yet
2 participants
@jjatria
Contributor

jjatria commented Jan 15, 2018

This patch implements the suggestion made in ticket 119855 on the RT queue, making rand_enum() assume the set key when passed a single array reference, such that a call like

my $char = rand_enum([qw( a b c d e f g h )])

is valid.

This contribution brought to you as part of the Pull Request Challenge.

@barefootcoder

This comment has been minimized.

Owner

barefootcoder commented Jan 24, 2018

This looks pretty good. There's a couple of minor tweaks I want to make, but I can do those after merging.

@barefootcoder barefootcoder merged commit 9145f26 into barefootcoder:master Jan 24, 2018

@jjatria jjatria deleted the jjatria:dwim-rand-enum branch Apr 22, 2018

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment