in reply to Re: File::System recursion
in thread File::System recursion

I figured if all directories found where returned as objects by File::System::Object, then I can easily create several files within the different objects, verifying content(with md5 maybe) and doing several other operations the File::System::Object has methods for, move, copy, delete, etc.

Replies are listed 'Best First'.
Re^3: File::System recursion
by mpeever (Friar) on Oct 30, 2008 at 04:01 UTC

    OK, I think I understand a little better what you were trying to accomplish.

    This seems to correctly return all the files in the File::System in a hash of hashes:

    #!/usr/bin/perl use strict; use Data::Dumper; use File::Find; use File::System; my $root = File::System->new( "Real", root => '/etc' ); my %files = map { my $file = $_; my %attrs = map { $_ => $file->get_property($_); } ( $_->propertie +s() ); $file => \%attrs; } $root->find( sub { 1 }, () ); print Dumper \%files;
    I realise that doesn't completely do what you want, but it seems to at least get the complete file tree back, without empty hashes...

    To be perfectly honest, I generally use File::Find out of a sense of guilt: I really prefer the interface from File::System::Object $obj -> find()