Term::Filter::Callback3pm
Simple callback-based wrapper for term::filter
Usage
use Term::Filter::Callback;my $term = Term::Filter::Callback->new(callbacks => {munge_input => sub {my $self = shift;my ($got) = @_;$got =~ s/\ce/E- Elbereth\n/g;$got;},munge_output => sub {my $self = shift;my ($got) = @_;$got =~ s/(Elbereth)/\e[35m$1\e[m/g;$got;},},);$term->run('nethack');
Version
version 0.03
Overview
This module provides a callback-based API to Term::Filter. The desired callbacks can just be passed into the constructor of this class, rather than requiring a new class to be manually defined. This class consumes the Term::Filter role, so the rest of the documentation in that module applies here.
Attributes
callbacks
A hashref of callbacks for Term::Filter. The keys are callback names and the values are coderefs to call for those callbacks.
Copyright and license
This software is copyright (c) 2012 by Jesse Luehrs.
This is free software; you can redistribute it and/or modify it under the same terms as the Perl 5 programming language system itself.
Releases
7 releases since Debian 7 (Wheezy); the text changed 2 times.