Term::Filter

Run an interactive terminal session, filtering the input and output
Download

Term::Filter Ranking & Summary

Advertisement

  • Rating:
  • License:
  • Perl Artistic License
  • Price:
  • FREE
  • Publisher Name:
  • Jesse Luehrs
  • Publisher web site:
  • http://search.cpan.org/~doy/

Term::Filter Tags


Term::Filter Description

This module is a Moose role which implements running a program in a pty while being able to filter the data that goes into and out of it. This can be used to alter the inputs and outputs of a terminal based program (as in the "SYNOPSIS"), or to intercept the data going in or out to record it or rebroadcast it (App::Ttyrec or App::Termcast, for instance).This role is intended to be consumed by a class which implements its callbacks as methods; for a simpler callback-based API, you may want to use Term::Filter::Callback instead.SYNOPSIS package My::Term::Filter; use Moose; with 'Term::Filter'; sub munge_input { my $self = shift; my ($got) = @_; $got =~ s/\ce/E- Elbereth\n/g; $got; } sub munge_output { my $self = shift; my ($got) = @_; $got =~ s/(Elbereth)/\e[35m$1\e[m/g; $got; } My::Term::Filter->new->run('nethack');Product's homepage


Term::Filter Related Software