RANDOM(1)

πŸ“¦ version 1.053, in alpine 3.24

πŸ’… RANDOM(1) β€” the perl one, bestie ✨

okay so real talk, this is a User Contributed Perl Documentation page, and the whole vibe is "tiny program, does one thing, ate." let's get into it πŸŽ€


✨ NAME ✨

random β€” the little tool that either shows you random lines or dips out with a random exit value. main character energy, honestly 🌈


πŸ¦‹ SYNOPSIS πŸ¦‹

random [-er] [denominator]

that's it. that's the whole thing. iconic πŸ’…


🌸 DESCRIPTION 🌸

so here's the tea πŸ“ β€” random reads lines from standard input, and then it shows each line on standard output with a chance of 1 / denominator. yes, like a lil probability gatekeeper. ngl that's kind of a serve.

but wait, there's more πŸ‘€ β€” if you pass the -e option, random doesn't do the line thing at all. instead it just exits with a value randomly choosen from 0 to "denominator - 1" inclusive. so it's giving "I'm not reading your input, I'm just picking a number and leaving." lowkey relatable 😭

and if you don't give a denominator at all? no worries bestie, it just uses 2. default slay ✨


πŸ’– OPTIONS πŸ’–

random accepts the following options, and there are literally two of them so you have no excuse:

  • -e β€” exit with a value randomly choosen from 0 to "denominator - 1" inclusive. it does not read input, and it does not display output. like, at all. it's out 🫢
  • -r β€” use unbuffered output. yes queen, no buffering, straight to the output πŸ’¨

🧚 ENVIRONMENT 🧚

okay so plot twist β€” nothing. the working of random is not influenced by any environment variables. not one. your env vars can stay home, this program doesn't want them πŸ™ˆ


πŸ’€ BUGS πŸ’€

there are no known bugs in random.

not me being obsessed with a program that just… works. no cap, she's flawless (allegedly πŸ‘‘). if you find one, that's between you and the universe 🌈


πŸ‘‘ AUTHOR πŸ‘‘

the Perl implementation of random was written by Abigail, and you can reach her at perlpowertools@abigail.be. shoutout to the legend, fr fr πŸ’œ


this program is copyright by Abigail 1999. vintage. retro. timeless ⭐

this program is free and open software. you may use, copy, modify, distribute and sell this program (and any modified variants) in any way you wish, provided you do not restrict others to doing the same. so go off, remix it, sell it, do whatever β€” just don't gatekeep it, bestie, that's the one rule 🫢✨


and that's the whole page! brought to you by perl v5.42.2, dated 2026-02-15 β€” a lil timestamp from the future, and honestly? she's timeless πŸ’– bye bestie, go randomize something πŸ¦‹

πŸ“¦ where this page comes from