Main > Programming > Libraries >

Iterator::IO 0.02

Iterator::IO 0.02

Sponsored Links

Iterator::IO 0.02 Ranking & Summary

RankingClick at the star to rank
Ranking Level
User Review: 0 (0 times)
File size: 0.014 MB
Platform: Any Platform
License: Perl Artistic License
Price:
Downloads: 912
Date added: 2007-04-27
Publisher: Eric J. Roode

Iterator::IO 0.02 description

Iterator::IO is a Perl module with filesystem and stream iterators.

SYNOPSIS

use Iterator::IO;

# Return the names of files in a directory (except . and ..)
$iter = idir_listing ($path);

# Return all the files in a directory tree, one at a time.
# Like File::Find, in slow motion.
$iter = idir_walk ($path);

# Return the lines of a file, one at a time.
$iter = ifile ($filename, %options);

# Return the lines of a file, in reverse order
$iter = ifile_reverse ($filename, %options);

This module provides filesystem and stream iterator functions. See the Iterator module for more information about how to use iterators.

FUNCTIONS

idir_listing

$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).

Requires IO::Dir and Cwd.

Example:

To return only certain files, combine this with an igrep:

$iter = igrep {-s && -M < 1} idir "/some/path";

(Returns non-empty files modified less than a day ago). (igrep) is defined in the Iterator::Util module).

idir_walk

$iter = idir_walk ($path);

Returns the files in a directory tree, one by one. Its sort of like File::Find in slow motion.

Requires IO::Dir and Cwd.

ifile

$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:

chomp

chomp => boolean indicates whether lines should be chomped before being returned by the iterator. The default is true.

$/

$/ => value specifies what string to use as the record separator. If not specified, the current value of $/ is used.

"rs" or "input_record_separator" may be used as option names instead of "$/", if you find that to be more readable. See the English module.

Option names are case-insensitive.

ifile requires IO::File.
ifile_reverse

$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.

INTERFACE CHANGE

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.

EXPORTS

This module exports all function names to the callers namespace by default.

DIAGNOSTICS

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.

Parameter Errors

Class: Iterator::X::Parameter_Error

You called an Iterator::IO function with one or more bad parameters. Since this is almost certainly a coding error, there is probably not much use in handling this sort of exception.

As a string, this exception provides a human-readable message about what the problem was.

Exhausted Iterators

Class: Iterator::X::Exhausted

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."

I/O Errors

Class: Iterator::X::IO_Error

This exception is thrown when any sort of I/O error occurs; this only happens with the filesystem iterators.

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 $!.

Internal Errors

Class: Iterator::X::Internal_Error

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.

Iterator::IO 0.02 Screenshot

Advertisements

Iterator::IO 0.02 Keywords

Bookmark Iterator::IO 0.02

Hyperlink code:
Link for forum:

Iterator::IO 0.02 Copyright

WareSeeker periodically updates pricing and software information of Iterator::IO 0.02 full version from the publisher, so some information may be slightly out-of-date. You should confirm all information before relying on it. Software piracy is theft, Using crack, password, serial numbers, registration codes, key generators is illegal and prevent future development of Iterator::IO 0.02 Edition. Download links are directly from our publisher sites, torrent files or links from rapidshare.com, yousendit.com or megaupload.com are not allowed

Allok Video Splitter 2.2.0 Review:

Name (Required)
Email(Required)
Captcha
Featured Software

Want to place your software product here?
Please contact us for consideration.

Contact WareSeeker.com
Related Software
Iterator is a general-purpose iterator class. Free Download
Iterator::Util Perl package contains essential utilities for the Iterator class. Free Download
Iterator::Misc Perl module package contains miscellaneous iterator functions. Free Download
PerlIO is a Perl module created to load on demand PerlIO layers and root of PerlIO::* name space. Free Download
Iterator::BreakOn is a Perl module to create iterators with control flow breaks. Free Download
SPOPS::Iterator is a class to cycle through results and return SPOPS objects. Free Download
IO::Interactive is a Perl module with utilities for interactive I/O. Free Download
B::Lint::StrictOO is a Perl module that applys strict to classes and methods. Free Download