Bug 82864

Summary: New Port: devel/p5-File-Random
Product: Ports & Packages Reporter: Aaron Dalton <aaron>
Component: Individual Port(s)Assignee: freebsd-ports-bugs (Nobody) <ports-bugs>
Status: Closed FIXED    
Severity: Affects Only Me    
Priority: Normal    
Version: Latest   
Hardware: Any   
OS: Any   
Attachments:
Description Flags
submission.txt none

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.