in reply to Show different text based on random number
my $rand = int(rand(4)); if ( 0 == $rand ) {} elsif ( 1 == $rand ) {} … etc
Don’t use perl4 style unless you know why you’re doing it, c.f. &subname (carries @_ context) instead of subname(). Always use strict and warnings. This seems XY and maybe solved elsewhere: Data::Random.
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: Show different text based on random number
by Discipulus (Canon) on Apr 22, 2016 at 06:55 UTC | |
by Your Mother (Archbishop) on Apr 22, 2016 at 11:17 UTC | |
by Discipulus (Canon) on Apr 22, 2016 at 11:39 UTC | |
by choroba (Cardinal) on Apr 22, 2016 at 12:10 UTC |