Softpedia
 


LINUX CATEGORIES:



GLOBAL PAGES >>
NEWS ARCHIVE >>
SOFTPEDIA REVIEWS >>
MEET THE EDITORS >>
WEEK'S BEST
  • Linux Kernel 3.9.3 / 3....
  • LibreOffice 3.6.6 / 4.0.3
  • MPlayer 1.1.1
  • systemd 204
  • Arch Linux 2013.05.01
  • Blender 2.67
  • KDE Software Compilatio...
  • CrunchBang Linux Stable...
  • Elementary OS 0.1 / 0.2...
  • SystemRescueCd 3.6.0
  • Home > Linux > Programming > Libraries

    Term::TtyRec::Plus 0.02

    Download button

    No screenshots available
    Downloads: 283  View global page NEW!  Tell us about an update
    User Rating:
    Rated by:
    NOT RATED
    0 user(s)
    Developer:

    License / Price:

    Last Updated:

    Category:
    Shawn M Moore | More programs
    Perl Artistic License / FREE
    January 5th, 2007, 05:05 GMT
    ROOT / Programming / Libraries

     Read user reviews (0)  Refer to a friend  Subscribe

    Term::TtyRec::Plus description

    Term::TtyRec::Plus is a Perl module to read a ttyrec.

    Term::TtyRec::Plus is a Perl module to read a ttyrec.

    SYNOPSIS

    Term::TtyRec::Plus is a module that lets you read ttyrec files. The related module, Term::TtyRec is designed more for simple interactions. Term::TtyRec::Plus gives you more information and, using a callback, lets you munge the data block and timestamp. It will do all the subtle work of making sure timing is kept consistent, and of rebuilding each frame header.

    use Term::TtyRec::Plus;

    my $ttyrec = Term::TtyRec::Plus->new();
    while ($frame_ref = $ttyrec->next_frame())
    {
    # do stuff with $frame_ref, e.g.
    $total_time += $frame_ref->{diff};
    }

    CONSTRUCTOR AND STARTUP

    new()

    Creates and returns a new Term::TtyRec::Plus object.

    my $ttyrec = Term::TtyRec::Plus->new();

    Parameters

    Here are the parameters that > recognizes.

    infile

    The input filename. A value of "-", which is the default, or undef, means STDIN.

    filehandle

    The input filehandle. By default this is undef; if you have already opened the ttyrec then you can pass its filehandle to the constructor. If both filehandle and infile are defined, filehandle is used.

    time_threshold

    The maximum difference between two frames, in seconds. If undef, which is the default, there is no enforced maximum. The second most common value would be 10, which some ttyrec utilities (such as timettyrec) use.

    frame_filter

    A callback, run for each frame before returning the frame to the user of Term::TtyRec::Plus. This callback receives three arguments: the frame text, the timestamp, and the timestamp of the previous frame. All three arguments are passed as scalar references. The previous frame's timestamp is undef for the first frame. The return value is not currently looked at. If you modify the timestamp, the module will make sure that change is noted and respected in further frame timestamps. Modifications to the previous frame's timestamp are currently ignored.

    sub halve_frame_time_and_stumblify
    {
    my ($data_ref, $time_ref, $prev_ref) = @_;
    $$time_ref = $$prev_ref + ($$time_ref - $$prev_ref) / 2
    if defined $$prev_ref;
    $$data_ref =~ s/Eidolos/Stumbly/g;
    }

    State

    In addition to passing arguments, you can modify Term::TtyRec::Plus's initial state, if you want to. This could be useful if you are chaining multiple ttyrecs together; you could pass a different initial frame. Support for such chaining might be added in a future version.

    frame

    The initial frame number. Default 0.

    prev_timestamp

    The previous frame's timestamp. Default undef.

    accum_diff

    The accumulated difference of all frames seen so far; see the section on diffed_timestamp in next_frame()'s return value. Default 0.

    relative_time

    The time passed since the first frame. Default 0.

    Requirements:

    · Perl



    Product's homepage

    Requirements:

    · Perl

      


    TAGS:

    read ttyrec | ttyrec interactions | Perl module | Term::TtyRec::Plus | read | ttyrec

    Go to top

    WindowsGamesDriversMacLinuxScriptsMobileHandheldNews

    SUBMIT PROGRAM   |   ADVERTISE   |   GET HELP   |   SEND US FEEDBACK   |   RSS FEEDS   |   UPDATE YOUR SOFTWARE   |   ROMANIAN FORUM