$iter = idir_listing ($path);
Iterator that returns the names of the files in the $path directory. If $path is omitted, defaults to the current directory. Does not return the . and .. files (under unix).
To return only certain files, combine this with an igrep:
$iter = idir_walk ($path);
$iter = ifile ($filename, \%options);
Opens a file, generates an iterator to return the lines of the file.
\%options is a reference to a hash of options. Currently, two options are supported:
Option names are case-insensitive.
ifile requires IO::File.
$iter = ifile_reverse ($filename, \%options);
Exactly the same as ifile, but reads the lines of the file backwards.
The input_record_separator option values undef (slurp whole file) and scalar references (fixed-length records) are not currently supported.
In version 0.01 of Iterator::IO, the ifile and ifile_reverse functions accepted their options in a different manner. This has now changed to operate via a hash reference of options. The old way will still work, but is deprecated and will be removed in a future release.
This module exports all function names to the callers namespace by default.
Iterator::IO uses Exception::Class objects for throwing exceptions. If youre not familiar with Exception::Class, dont worry; these exception objects work just like $@ does with die and croak, but they are easier to work with if you are trapping errors.
See the Iterator module documentation for more information on how to trap and handle these exception objects.
o Parameter Errors
As a string, this exception provides a human-readable message about what the problem was.
o Exhausted Iterators
You called value on an iterator that is exhausted; that is, there are no more values in the sequence to return.
As a string, this exception is Iterator is exhausted.
o I/O Errors
This exception has one method, os_error, which returns the original $! that was trapped by the Iterator object.
As a string, this exception provides some human-readable information along with $!.
o Internal Errors
Something happened that I thought couldnt possibly happen. I would appreciate it if you could send me an email message detailing the circumstances of the error.
Requires the following additional modules:
Higher Order Perl, Mark Jason Dominus, Morgan Kauffman 2005.
Much thanks to Will Coleda and Paul Lalli (and the RPI lily crowd in general) for suggestions for the pre-release version.
Eric J. Roode, email@example.com
Copyright (c) 2005 by Eric J. Roode. All Rights Reserved. This module is free software; you can redistribute it and/or modify it under the same terms as Perl itself.
To avoid my spam filter, please include Perl, module, or this modules name in the messages subject line, and/or GPG-sign your message.
|perl v5.20.3||IO (3)||2005-08-23|