Catman...:random(3pm)
π NAME π
okay so bestie, welcome to Catmandu::Fix::random β the little Fix that literally just makes a random number and drops it in a field. that's it. that's the whole job. iconic behaviour honestly. β¨
she lives in the Catmandu::Fix family, and she's here to β¨create an random number in a fieldβ¨ (yes the grammar is the original's, no I will not be fixing it, it's part of her charm π«Ά).
π SYNOPSIS π
okay so here's how you use her. the vibe is: you name a field, you give her a number, she gives you a random value from 0 up to but not including that number. no cap. π
# Add a new field 'foo' with a random value between 0 and 9
random(foo, 10)
# Add a new field 'my.random.number' with a random value 0 or 1
random(my.random.number,2)
so in the first one you're saying "bestie give me a foo and roll me a number from 0 to 9" πΈ and in the second one you want my.random.number and you only want 0 or 1 β a little coin flip, a little yes/no, a little main character decision π₯
also notice: dots in the field name are totally fine, my.random.number just goes in as one nested-ish name and she does not complain. periodt. π
π SEE ALSO π
Catmandu::Fixβ the mothership, the whole reason any of this works, go say hi to her π
and that's the tea, bestie π β this page came to you courtesy of perl v5.40.1, dated 2026-01-24, straight from the User Contributed Perl Documentation files. go forth and randomise responsibly. mwah π β¨
π¦ where this page comes from
- ubuntu resolute: libcatmandu-perl 1.2025-1 Β· Artistic-1.0-Perl OR GPL-1.0-or-later
- ubuntu stonking: libcatmandu-perl 1.2025-1 Β· Artistic-1.0-Perl OR GPL-1.0-or-later
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms