NAME

PerlIO::if - Push layers conditionally

VERSION

version 0.003

SYNOPSIS

open my $fh, '<:if(!crlf,crlf)', $filename;

DESCRIPTION

This module provides a conditional PerlIO layer.

SYNTAX

This modules does not have to be loaded explicitly, it will be loaded automatically by using it in an open mode

The argument must have the following general syntax:

:if(condition,layer)

layer may be any layer installed on the system.

condition may be any test from the following list:

  • buffered

    True if there is a buffered layer in the IO stack.

  • crlf

    True if there is a layer doing crlf translation

  • can_crlf

    True if there is a layer that is capable of doing crlf translation

TODO

  • Add more conditions

  • Add and ifelse pseudo-layer

AUTHOR

Leon Timmermans <fawaka@gmail.com>

COPYRIGHT AND LICENSE

This software is copyright (c) 2011 by Leon Timmermans.

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