File::Find::Closures

File::Find::Closures is a Perl module with functions you can use with File::Find.
Download

File::Find::Closures Ranking & Summary

Advertisement

  • Rating:
  • License:
  • Perl Artistic License
  • Price:
  • FREE
  • Publisher Name:
  • brian d foy
  • Publisher web site:
  • http://search.cpan.org/~bdfoy/

File::Find::Closures Tags


File::Find::Closures Description

File::Find::Closures is a Perl module with functions you can use with File::Find. File::Find::Closures is a Perl module with functions you can use with File::Find.SYNOPSIS use File::Find; use File::Find::Closures qw(:all); my( $wanted, $list_reporter ) = find_by_name( qw(README) ); File::Find::find( $wanted, @directories ); File::Find::find( { wanted => $wanted, ... }, @directories ); my @readmes = $list_reporter->();SOME PARTS ARE NOT IMPLEMENTED YET! THIS IS ALPHA ALPHA SOFTWARE: A MERE SHELL OF AN IDEA.I wrote this module as an example of both using closures and using File::Find. Students are always asking me what closures are good for, and here's some examples. The functions mostly stand alone (i.e. they don't need the rest of the module), so rather than creating a dependency in your code, just lift the parts you want).When I use File::Find, I have two headaches---coming up with the &wanted function to pass to find(), and acculumating the files.This module provides the &wanted functions as a closures that I can pass directly to find(). Actually, for each pre-made closure, I provide a closure to access the list of files too, so I don't have to create a new array to hold the results.The filenames are the full path to the file as reported by File::Find.Unless otherwise noted, the reporter closure returns a list of the filenames in list context and an anonymous array that is a copy (not a reference) of the original list. The filenames have been normalized by File::Spec::canonfile unless otherwise noted. The list of files has been processed by File::Spec::no_upwards so that "." and ".." (or their equivalents) do not show up in the list. Requirements: · Perl


File::Find::Closures Related Software