in reply to Re^2: Show different text based on random number
in thread Show different text based on random number
#!/usr/bin/env perl use strict; use warnings; use Path::Tiny; my @choices = ( path('c1.txt'), path('c2.txt'), path('c3.txt'), path('c4.txt'), ); my $random_path = $choices[rand scalar @choices]; my $text = $random_path->slurp; print "The text is: $text\n"; exit;
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^4: Show different text based on random number
by htmanning (Friar) on Apr 22, 2016 at 05:48 UTC | |
by kevbot (Vicar) on Apr 22, 2016 at 06:01 UTC | |
by htmanning (Friar) on Apr 22, 2016 at 06:02 UTC | |
by beech (Parson) on Apr 22, 2016 at 06:21 UTC |