GSP
Quick Navigator

Search Site

Unix VPS
A - Starter
B - Basic
C - Preferred
D - Commercial
MPS - Dedicated
Previous VPSs
* Sign Up! *

Support
Contact Us
Online Help
Handbooks
Domain Status
Man Pages

FAQ
Virtual Servers
Pricing
Billing
Technical

Network
Facilities
Connectivity
Topology Map

Miscellaneous
Server Agreement
Year 2038
Credits
 

USA Flag

 

 

Man Pages
File::Find::Object(3) User Contributed Perl Documentation File::Find::Object(3)

File::Find::Object - An object oriented File::Find replacement

version v0.3.2

    use File::Find::Object;
    my $tree = File::Find::Object->new({}, @targets);

    while (my $r = $tree->next()) {
        print $r ."\n";
    }

File::Find::Object does the same job as File::Find but works like an object and with an iterator. As File::Find is not object oriented, one cannot perform multiple searches in the same application. The second problem of File::Find is its file processing: after starting its main loop, one cannot easily wait for another event and so get the next result.

With File::Find::Object you can get the next file by calling the next() function, but setting a callback is still possible.

    my $ffo = File::Find::Object->new( { options }, @targets);

Create a new File::Find::Object object. @targets is the list of directories or files which the object should explore.

options

depth
Boolean - returns the directory content before the directory itself.
nocrossfs
Boolean - doesn't continue on filesystems different than the parent.
followlink
Boolean - follow symlinks when they point to a directory.

You can safely set this option to true as File::Find::Object does not follow the link if it detects a loop.

filter
Function reference - should point to a function returning TRUE or FALSE. This function is called with the filename to filter, if the function return FALSE, the file is skipped.
callback
Function reference - should point to a function, which would be called each time a new file is returned. The function is called with the current filename as an argument.

Returns the next file found by the File::Find::Object. It returns undef once the scan is completed.

Returns the current filename found by the File::Find::Object object, i.e: the last value returned by next().

Like next() only returns the result as a convenient File::Find::Object::Result object. "$ff->next()" is equivalent to "$ff->next_obj()->path()".

Like item() only returns the result as a convenient File::Find::Object::Result object. "$ff->item()" is equivalent to "$ff->item_obj()->path()".

Sets the children to traverse to from the current node. Useful for pruning items to traverse.

Accepts a single array reference.

Example:

    $ff->set_traverse_to([ grep { ! /\A\./ } @{ $ff->get_traverse_to }]);

Prunes the current directory. Equivalent to $ff->set_traverse_to([]).

Retrieves the children that will be traversed to. Returns a single array reference.

(Example under "set_traverse_to").

Gets all the files that appear in the current directory. This value remains constant for every node, even after traversal or calls to "set_traverse_to()" and is useful to use as the basis of the argument for "set_traverse_to()".

Returns a single array reference.

No bugs are known, but it doesn't mean there aren't any.

There's an article about this module in the Perl Advent Calendar of 2006: <http://perladvent.pm.org/2006/2/>.

File::Find is the core module for traversing files in perl, which has several limitations.

File::Next, File::Find::Iterator, File::Walker and the unmaintained File::FTS are alternatives to this module.

Copyright (C) 2005, 2006 by Olivier Thauvin

This package is free software; you can redistribute it and/or modify it under the following terms:

1. The GNU General Public License Version 2.0 - http://www.opensource.org/licenses/gpl-license.php

2. The Artistic License Version 2.0 - http://www.perlfoundation.org/legal/licenses/artistic-2_0.html

3. At your option - any later version of either or both of these licenses.

Shlomi Fish <shlomif@cpan.org>

This software is Copyright (c) 2000 by Olivier Thauvin and others.

This is free software, licensed under:

  The Artistic License 2.0 (GPL Compatible)

Please report any bugs or feature requests on the bugtracker website http://rt.cpan.org/NoAuth/Bugs.html?Dist=File-Find-Object or by email to bug-file-find-object@rt.cpan.org.

When submitting a bug or request, please include a test-file or a patch to an existing test-file that illustrates the bug or desired feature.

You can find documentation for this module with the perldoc command.

  perldoc File::Find::Object

The following websites have more information about this module, and may be of help to you. As always, in addition to those websites please use your favorite search engine to discover more resources.
  • MetaCPAN

    A modern, open-source CPAN search engine, useful to view POD in HTML format.

    <http://metacpan.org/release/File-Find-Object>

  • Search CPAN

    The default CPAN search engine, useful to view POD in HTML format.

    <http://search.cpan.org/dist/File-Find-Object>

  • RT: CPAN's Bug Tracker

    The RT ( Request Tracker ) website is the default bug/issue tracking system for CPAN.

    <https://rt.cpan.org/Public/Dist/Display.html?Name=File-Find-Object>

  • AnnoCPAN

    The AnnoCPAN is a website that allows community annotations of Perl module documentation.

    <http://annocpan.org/dist/File-Find-Object>

  • CPAN Ratings

    The CPAN Ratings is a website that allows community ratings and reviews of Perl modules.

    <http://cpanratings.perl.org/d/File-Find-Object>

  • CPAN Forum

    The CPAN Forum is a web forum for discussing Perl modules.

    <http://cpanforum.com/dist/File-Find-Object>

  • CPANTS

    The CPANTS is a website that analyzes the Kwalitee ( code metrics ) of a distribution.

    <http://cpants.cpanauthors.org/dist/File-Find-Object>

  • CPAN Testers

    The CPAN Testers is a network of smokers who run automated tests on uploaded CPAN distributions.

    <http://www.cpantesters.org/distro/F/File-Find-Object>

  • CPAN Testers Matrix

    The CPAN Testers Matrix is a website that provides a visual overview of the test results for a distribution on various Perls/platforms.

    <http://matrix.cpantesters.org/?dist=File-Find-Object>

  • CPAN Testers Dependencies

    The CPAN Testers Dependencies is a website that shows a chart of the test results of all dependencies for a distribution.

    <http://deps.cpantesters.org/?module=File::Find::Object>

Please report any bugs or feature requests by email to "bug-file-find-object at rt.cpan.org", or through the web interface at <https://rt.cpan.org/Public/Bug/Report.html?Queue=File-Find-Object>. You will be automatically notified of any progress on the request by the system.

The code is open to the world, and available for you to hack on. Please feel free to browse it and play with it, or whatever. If you want to contribute patches, please send me a diff or prod me to pull from your repository :)

<http://bitbucket.org/shlomif/perl-file-find-object>

  hg clone ssh://hg@bitbucket.org/shlomif/perl-file-find-object
2017-01-13 perl v5.32.1

Search for    or go to Top of page |  Section 3 |  Main Index

Powered by GSP Visit the GSP FreeBSD Man Page Interface.
Output converted with ManDoc.