Term::TtyRec::Plus 0.02
Sponsored Links
Term::TtyRec::Plus 0.02 Ranking & Summary
File size:
0.056 MB
Platform:
Any Platform
License:
Perl Artistic License
Price:
Downloads:
1023
Date added:
2007-01-04
Publisher:
Shawn M Moore
Term::TtyRec::Plus 0.02 description
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 frames 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 frames 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::Pluss 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 frames 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.
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
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 frames 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 frames 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::Pluss 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 frames 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.
Term::TtyRec::Plus 0.02 Screenshot
Term::TtyRec::Plus 0.02 Keywords
TtyRec
Plus 0.02
Default 0
to read
Perl module
frame
ref
timestamp
time
module
default
Term::TtyRec::Plus
TermTtyRecPlus
Term::TtyRec::Plus 0.02
Libraries
Programming
Bookmark Term::TtyRec::Plus 0.02
Term::TtyRec::Plus 0.02 Copyright
WareSeeker periodically updates pricing and software information of Term::TtyRec::Plus 0.02 full version from the publisher, so some information may be slightly out-of-date. You should confirm all information before relying on it. Software piracy is theft, Using crack, password, serial numbers, registration codes, key generators is illegal and prevent future development of Term::TtyRec::Plus 0.02 Edition. Download links are directly from our publisher sites, torrent files or links from rapidshare.com, yousendit.com or megaupload.com are not allowed
Featured Software
Want to place your software product here?
Please contact us for consideration.
Contact WareSeeker.com
Related Information
Related Software
Term::TtyRec::Player is a Perl module that playbacks ttyrec data. Free Download
Template::Plugin::Datum is a Perl module with TT2 plugin that converts international date format to German date format. Free Download
PerlIO is a Perl module created to load on demand PerlIO layers and root of PerlIO::* name space. Free Download
Geo::Track::Log is a Perl module that represent track logs and find a location based on a track log and a date. Free Download
Time::Format is a Perl module for easy-to-use date/time formatting. Free Download
XML::Quick is a Perl module to generate XML from hashes (and other data). Free Download
Test::Signature is a Perl module to automate SIGNATURE testing. Free Download
Convert::Base32 is a Perl module for encoding and decoding of base32 strings. Free Download
Latest Software
Popular Software
Favourite Software