The Perl Toolchain Summit needs more sponsors. If your company depends on Perl, please support this very important event.

NAME

util::filter - optex fitler utility module

SYNOPSIS

optex [ --if/--of command ] command

optex [ --isub/--osub function ] command

optex command -Mutil::filter [ options ]

OPTION

--if command
--of command

Set input/output filter command. If the command start by &, module function is called instead.

--isub function
--osub function

Set input/output function. Tis is shortcut for --if &function.

--set-io-color IO=color

Set color filter to filehandle. You can set color filter for STDERR like this:

    --set-io-color STDERR=R

Use comma to set multiple filehandles at once.

    --set-io-color STDIN=B,STDERR=R
--io-color

Set default color to STDOUT and STDERR.

DESCRIPTION

This module is a collection of sample utility functions for command optex.

Function can be called with option declaration. Parameters for the function are passed by name and value list: name=value. Value 1 is assigned for the name without value.

In this example,

    optex -Mutil::function(debug,message=hello,count=3)

option debug has value 1, message has string "hello", and count also has string "3".

FUNCTION

set()

Set input/output filter.

rev_line()

Reverse output.

rev_char()

Reverse characters in each line.

shuffle_line()

Shuffle lines.

io_color( IO=color )

Colorize text. IO is either of STDOUT or STDERR. Use comma to set both at a same time: STDOUT=C,STDERR=R.

splice_line( offset=n, [ length=m ] )

Splice lines.

timestamp( [ format=strftime_format ] )

Put timestamp on each line of output.

gunzip()

Gunzip standard input.

gzip()

Gzip standard input.