1
0
mirror of https://git.FreeBSD.org/ports.git synced 2024-12-14 03:10:47 +00:00
freebsd-ports/devel/p5-File-Random/pkg-descr
Erwin Lansing fbf7bc4864 Add p5-File-Random 0.17, perl module for random selecting of a file.
PR:		ports/82864
Submitted by:	Aaron Dalton <aaron@daltons.ca>
2005-07-22 11:04:36 +00:00

24 lines
727 B
Plaintext

This module simplifies the routine job of selecting a random file. (As you
can find at CGI scripts). It's done, because it's boring (and
errorprone), always to write something like
my @files = (<*.*>);
my $randf = $files[rand @files];
or
opendir DIR, " ... " or die " ... ";
my @files = grep {-f ...} (readdir DIR);
closedir DIR;
my $randf = $files[rand @files];
It also becomes very boring and very dangerous to write randomly selection
for subdirectory searching with special check-routines. The simple
standard job of selecting a random line from a file is implemented, too.
WWW: http://search.cpan.org/dist/File-Random/
Author: Janek Schleicher <bigj@kamelfreund.de>
- Aaron Dalton
aaron@daltons.ca