Actions Status MetaCPAN Release

NAME

IO::Factotum - read files through a converter chosen by their names

SYNOPSIS

use IO::Factotum;

IO::Factotum::register(
    match   => qr/\.gz$/,
    command => [ 'gzip', '-dc' ],
);

my $fh = IO::Factotum::open_input($file) or die "$file: $!";
while (<$fh>) {
    ...
}

VERSION

Version 0.03

DESCRIPTION

A factotum is a person who does all kinds of work for someone. This module is one for the files a program reads: tell it what to do with which files, and it gives them to the program ready to read. A file is opened through a converter chosen by its name, and the handle gives the output of the converter instead of the content of the file. The file itself is not changed, and the program keeps its name.

Converters are registered with a condition on the file name. A file which no converter takes, and a file whose converter fails, is read as it is.

FUNCTIONS

Nothing is exported.

SEE ALSO

IO::Factotum::skylighting, IO::Factotum::sourcehighlight, Getopt::EX::Factotum

Command::Run

AUTHOR

Kazumasa Utashiro

LICENSE

Copyright 2026 Kazumasa Utashiro.

This library is free software; you can redistribute it and/or modify it under the same terms as Perl itself.