Beefy Boxes and Bandwidth Generously Provided by pair Networks
more useful options

Re: RFC: Proofread POD for my main random module, please? (more)

by hippo (Chancellor)
on Jun 01, 2017 at 22:04 UTC ( #1191901=note: print w/replies, xml ) Need Help??

in reply to RFC: Proofread POD for my main random module, please? (more)

In your synopsis you have this line:

my $random_thing = random($hash_of_arrays, $list, $options);

but in reading the source it appears that the second argument is expected to be a scalar, not a list. That's confusing.

Also you say several times, "When XXX is selected" but give no clue as to what "selected" means in this context. Again, it is only by reading the source that we can see you mean "passed as a literal value as the second argument to random()".

I think it would help a great deal if in your snippet listing the example random_color() sub you were actually to specify values for the three variables instead of leaving us all to wonder what they might be (or even what form they should take). eg.

my $key = 'foo'; my $additions = 'elephant'; my $color_hash = { a => [qw/ I do not know /], b => [qw/ what should + go here /] }; my $rv = random_color ($key, $additions); sub random_color { my ($color_key, $color_additions) = @_; random($color_hash, $color_key, { caller => 'random_color', additi +ons => $color_additions}); }

Finally, I don't see why instant_rand() is so named. Why not list_item_rand()?


Log In?

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://1191901]
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others cooling their heels in the Monastery: (8)
As of 2020-12-04 08:53 GMT
Find Nodes?
    Voting Booth?
    How often do you use taint mode?

    Results (58 votes). Check out past polls.