Bug 82864 - New Port: devel/p5-File-Random
Summary: New Port: devel/p5-File-Random
Status: Closed FIXED
Alias: None
Product: Ports & Packages
Classification: Unclassified
Component: Individual Port(s) (show other bugs)
Version: Latest
Hardware: Any Any
: Normal Affects Only Me
Assignee: freebsd-ports-bugs (Nobody)
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2005-07-01 16:40 UTC by Aaron Dalton
Modified: 2005-07-22 12:05 UTC (History)
0 users

See Also:


Attachments
submission.txt (2.66 KB, text/plain)
2005-07-01 16:40 UTC, Aaron Dalton
no flags Details

Note You need to log in before you can comment on or make changes to this bug.
Description Aaron Dalton 2005-07-01 16:40:17 UTC
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.

-----
NOTE: This module has a large number of prerequisites used solely for 
testing.  Since the ports system does not do the 'make test' step, I have 
omitted these prereqs in the Makefile.  This means, however, that a number 
of warnings will be output at the 'perl Makefile.PL' stage.  I do not know 
if there is a conventional way to suppress such warnings.
Comment 1 Erwin Lansing freebsd_committer freebsd_triage 2005-07-22 12:04:27 UTC
State Changed
From-To: open->closed

Port added, thanks! 

I added a requirement for perl version 5.6.0 or higher due to 
it's dependency on p5-Want. 

You can patch Makefile.PL the usual way, so it no longer 
tests for the dependencies that are not necessary for  
normal operation and only for testing to avoid the warnings, 
which our users would appreciate.