Florian Ragwitz

NAME

IO::Dir::Recursive - IO::Dir working recursive

SYNOPSIS

  use IO::Dir::Recursive;
  
  my $dh = IO::Dir::Recursive->new('.');
  print "$_\n" while $dh->read();

  tie my %dir, 'IO::Dir::Recursive', '.';
  
  print $dir{subdir1}->{subdir2}->{file}->slurp();

DESCRIPTION

IO::Dir::Recursive gives IO::Dir the ability to work recursive.

EXPORT

The following constans may be imported on request.

  • DIR_NOUPWARDS

    This constant can be passed as option to tie to strip out parent directories.

  • DIR_UNLINK

    This is inherited from IO::Dir. Deleting an element from the hash will delete the corresponding file or subdirectory if this constant is passed as a tie option.

METHODS

IO::Dir::Recursive inherits from IO::Dir and therefor inherits all its methods with the following exceptions.

read

 my $item = $dh->read();

Reads the next item in $dh and returns the coresponding object for the item: an IO::Dir::Recursive instance for directories, an IO::All instance for files or undef if there are no other items left.

_read

 my $next = $dh->_read();

Same as read() above, but returns a string describing the next item instead of an object. Mainly for internal use, but maybe it's useful in some other places, too.

SEE ALSO

IO::Dir, IO::All

AUTHOR

Florian Ragwitz, <flora@cpan.org>

COPYRIGHT AND LICENSE

Copyright (C) 2005 by Florian Ragwitz

This library is free software; you can redistribute it and/or modify it under the same terms as Perl itself, either Perl version 5.8.7 or, at your option, any later version of Perl 5 you may have available.

1 POD Error

The following errors were encountered while parsing the POD:

Around line 55:

You forgot a '=back' before '=head1'