predictive text
Sponsored Links
Sponsored Links
Secleted [ 0 ] software to compare
Results 1 - 15 of about 2974
WEbTide Unix 1.3
WebTide freeware HTML editor more>> The WebTide text editor is a new free HTML editor. It is designed to help web developers in creating fast and professional websites. It is also a programmer text editor.<<less
Download (1447)
Added: 2009-04-09 License: Freeware Price: Free
201 downloads
Text::MetaMarkup::HTML 0.01
Text::MetaMarkup::HTML is a MM-to-HTML converter. more>>
Text::MetaMarkup::HTML is a MM-to-HTML converter.
SYNOPSIS
use Text::MetaMarkup::HTML;
print Text::MetaMarkup::HTML->new->parse(file => $filename);
This module extends Text::MetaMarkup and converts the parsed document to HTML.
Text::MetaMarkup::HTML adds special support for the following tags:
Paragraph tag style
Its contents are not subject to escaping and inline tag interpolation.
EXAMPLE
Input
h1: Example
This is just {i:an {b:example}}.
* foo
* bar
* baz
Output
< h1 >Example< /h1 >
< p >This is just < i >an < b >example< /b >< /i >.
< ol >< li >foo< /i >
< li >bar< /li >
< li >baz< /li >< /ol >
<<lessSYNOPSIS
use Text::MetaMarkup::HTML;
print Text::MetaMarkup::HTML->new->parse(file => $filename);
This module extends Text::MetaMarkup and converts the parsed document to HTML.
Text::MetaMarkup::HTML adds special support for the following tags:
Paragraph tag style
Its contents are not subject to escaping and inline tag interpolation.
EXAMPLE
Input
h1: Example
This is just {i:an {b:example}}.
* foo
* bar
* baz
Output
< h1 >Example< /h1 >
< p >This is just < i >an < b >example< /b >< /i >.
< ol >< li >foo< /i >
< li >bar< /li >
< li >baz< /li >< /ol >
Download (0.006MB)
Added: 2007-08-22 License: Perl Artistic License Price:
494 downloads
Text::Reform 1.11
Text::Reform is a Perl module for manual text wrapping and reformatting. more>>
Text::Reform is a Perl module for manual text wrapping and reformatting.
SYNOPSIS
use Text::Reform;
print form $template,
$data, $to, $fill, $it, $with;
use Text::Reform qw( tag );
print tag B, $enboldened_text;
The form sub
The form() subroutine may be exported from the module. It takes a series of format (or "picture") strings followed by replacement values, interpolates those values into each picture string, and returns the result. The effect is similar to the inbuilt perl format mechanism, although the field specification syntax is simpler and some of the formatting behaviour is more sophisticated.
A picture string consists of sequences of the following characters:
<
Left-justified field indicator. A series of two or more sequential
Right-justified field indicator. A series of two or more sequential >s specify a right-justified field to be filled by a subsequent value. A single < is formatted as the literal character <
Fully-justified field indicator. Field may be of any width, and brackets need not balance, but there must be at least 2 < and 2 >.
^
Centre-justified field indicator. A series of two or more sequential ^s specify a centred field to be filled by a subsequent value. A single ^ is formatted as the literal character <
>>>. br ]]].[[[[ br br A numerically formatted block field with the specified number of digits to either side of the decimal place. Just like a >>.<<less
SYNOPSIS
use Text::Reform;
print form $template,
$data, $to, $fill, $it, $with;
use Text::Reform qw( tag );
print tag B, $enboldened_text;
The form sub
The form() subroutine may be exported from the module. It takes a series of format (or "picture") strings followed by replacement values, interpolates those values into each picture string, and returns the result. The effect is similar to the inbuilt perl format mechanism, although the field specification syntax is simpler and some of the formatting behaviour is more sophisticated.
A picture string consists of sequences of the following characters:
<
Left-justified field indicator. A series of two or more sequential
Right-justified field indicator. A series of two or more sequential >s specify a right-justified field to be filled by a subsequent value. A single < is formatted as the literal character <
Fully-justified field indicator. Field may be of any width, and brackets need not balance, but there must be at least 2 < and 2 >.
^
Centre-justified field indicator. A series of two or more sequential ^s specify a centred field to be filled by a subsequent value. A single ^ is formatted as the literal character <
>>>. br ]]].[[[[ br br A numerically formatted block field with the specified number of digits to either side of the decimal place. Just like a >>.<<less
Download (0.020MB)
Added: 2007-08-22 License: Perl Artistic License Price:
793 downloads
Text::Template::Inline 0.13
Text::Template::Inline allows easy formatting of hierarchical data. more>>
Text::Template::Inline allows easy formatting of hierarchical data.
SYNOPSIS
# you can import any name you want instead of "render"
use Text::Template::Inline render;
# yields "Replace things and stuff."
render {
foo => things,
bar => stuff,
}, q ;
# yields "Three Two One Zero"
render [qw/ Zero One Two Three /], {3} {2} {1} {0};
# for a blessed $obj that has id and name accessors:
render $obj, {id} {name};
# a "fat comma" can be used as syntactic sugar:
render $obj => {id} {name};
# its also possible to traverse heirarchies of data,
# even of different types.
# the following yields "one two three"
render {
a => { d => one },
b => { e => two },
c => { f => [qw/ zero one two three /], },
} => {a.d} {b.e} {c.f.3};
# theres also an automatic unindent feature that
# lines up to the least-indented line in the template:
render {
a => { d => one },
b => { e => two },
c => { f => [qw/ zero one two three /], },
} => q{
{a.d}
{b.e}
{c.f.3}
};
# the above results in this:
one
two
three
<<lessSYNOPSIS
# you can import any name you want instead of "render"
use Text::Template::Inline render;
# yields "Replace things and stuff."
render {
foo => things,
bar => stuff,
}, q ;
# yields "Three Two One Zero"
render [qw/ Zero One Two Three /], {3} {2} {1} {0};
# for a blessed $obj that has id and name accessors:
render $obj, {id} {name};
# a "fat comma" can be used as syntactic sugar:
render $obj => {id} {name};
# its also possible to traverse heirarchies of data,
# even of different types.
# the following yields "one two three"
render {
a => { d => one },
b => { e => two },
c => { f => [qw/ zero one two three /], },
} => {a.d} {b.e} {c.f.3};
# theres also an automatic unindent feature that
# lines up to the least-indented line in the template:
render {
a => { d => one },
b => { e => two },
c => { f => [qw/ zero one two three /], },
} => q{
{a.d}
{b.e}
{c.f.3}
};
# the above results in this:
one
two
three
Download (0.006MB)
Added: 2007-08-22 License: Perl Artistic License Price:
793 downloads
Text::Scraper 0.02
Text::Scraper contains structured data from (un)structured text. more>>
Text::Scraper contains structured data from (un)structured text.
SYNOPSIS
use Text::Scraper;
use LWP::Simple;
use Data::Dumper;
#
# 1. Get our template and source text
#
my $tmpl = Text::Scraper->slurp(*DATA);
my $src = get(http://search.cpan.org/recent) || die $!;
#
# 2. Extract data from source
#
my $obj = Text::Scraper->new(tmpl => $tmpl);
my $data = $obj->scrape($src);
#
# 3. Do something really neat...(left as excercise)
#
print "Newest Submission: ", $data->[0]{submissions}[0]{name}, "nn";
print "Scraper model:n", Dumper($obj), "nn";
print "Parsed model:n", Dumper($data) , "nn";
__DATA__
< div class=path>< center>< table>< tr>
< ?tmpl stuff pre_nav ?>
< td class=datecell>< span>< big>< b> < ?tmpl var date_string ?> < /b>< /big>< /span>< /td>
< ?tmpl stuff post_nav ?>
< /tr>< /table>< /center>< /div>
< ul>
< ?tmpl loop submissions ?>
< li>< a href="< ?tmpl var link ?>">< ?tmpl var name ?>< /a>
< ?tmpl if has_description ?>
< small> -- < ?tmpl var description ?>< /small>
< ?tmpl end has_description ?>
< /li>
< ?tmpl end submissions ?>
< /ul>
ABSTRACT
Text::Scraper provides a fully functional base-class to quickly develop Screen-Scrapers and other text extraction tools. Programmatically generated text such as dynamic webpages are trivially reversed engineered.
Using templates, the programmer is freed from staring at fragile, heavily escaped regular expressions, mapping capture groups to named variables or wrestling with the DOM and badly formed HTML. In addition, extracted data can be hierarchical, which is beyond the capabilities of vanilla regular expressions.
Text::Scrapers functionality overlaps some existing CPAN modules - Template::Extract and WWW::Scraper.
Text::Scraper is much more lightweight than either and has a more general application domain than the latter. It has no dependencies on other frameworks, modules or design-decisions. On average, Text::Scraper benchmarks around 250% faster than Template::Extract - and uses significantly less memory.
Unlike both existing modules, Text::Scraper generalizes its functionality to allow the programmer to refine template capture groups beyond (.*?), fully redefine the template syntax and introduce new template constructs bound to custom classes.
<<lessSYNOPSIS
use Text::Scraper;
use LWP::Simple;
use Data::Dumper;
#
# 1. Get our template and source text
#
my $tmpl = Text::Scraper->slurp(*DATA);
my $src = get(http://search.cpan.org/recent) || die $!;
#
# 2. Extract data from source
#
my $obj = Text::Scraper->new(tmpl => $tmpl);
my $data = $obj->scrape($src);
#
# 3. Do something really neat...(left as excercise)
#
print "Newest Submission: ", $data->[0]{submissions}[0]{name}, "nn";
print "Scraper model:n", Dumper($obj), "nn";
print "Parsed model:n", Dumper($data) , "nn";
__DATA__
< div class=path>< center>< table>< tr>
< ?tmpl stuff pre_nav ?>
< td class=datecell>< span>< big>< b> < ?tmpl var date_string ?> < /b>< /big>< /span>< /td>
< ?tmpl stuff post_nav ?>
< /tr>< /table>< /center>< /div>
< ul>
< ?tmpl loop submissions ?>
< li>< a href="< ?tmpl var link ?>">< ?tmpl var name ?>< /a>
< ?tmpl if has_description ?>
< small> -- < ?tmpl var description ?>< /small>
< ?tmpl end has_description ?>
< /li>
< ?tmpl end submissions ?>
< /ul>
ABSTRACT
Text::Scraper provides a fully functional base-class to quickly develop Screen-Scrapers and other text extraction tools. Programmatically generated text such as dynamic webpages are trivially reversed engineered.
Using templates, the programmer is freed from staring at fragile, heavily escaped regular expressions, mapping capture groups to named variables or wrestling with the DOM and badly formed HTML. In addition, extracted data can be hierarchical, which is beyond the capabilities of vanilla regular expressions.
Text::Scrapers functionality overlaps some existing CPAN modules - Template::Extract and WWW::Scraper.
Text::Scraper is much more lightweight than either and has a more general application domain than the latter. It has no dependencies on other frameworks, modules or design-decisions. On average, Text::Scraper benchmarks around 250% faster than Template::Extract - and uses significantly less memory.
Unlike both existing modules, Text::Scraper generalizes its functionality to allow the programmer to refine template capture groups beyond (.*?), fully redefine the template syntax and introduce new template constructs bound to custom classes.
Download (0.045MB)
Added: 2007-08-22 License: Perl Artistic License Price:
796 downloads
Text::vFile::toXML 0.03
Text::vFile::toXML can convert vFiles into equivalent XML. more>>
Text::vFile::toXML can convert vFiles into equivalent XML.
SYNOPSIS
This module converts iCalendar (iCal : generically, vFile) files into their (equivalent) XML (xCalendar / xCal) representation, according to Royers IETF Draft (http://tools.ietf.org/html/draft-royer-calsch-xcal-03).
# Enable functional interface
use Text::vFile::toXML qw(to_xml);
# Input filename
my $arg = "input.file";
my $a = Text::vFile::toXML->new(filename => $arg)->to_xml;
my $b = Text::vFile::toXML->new(filehandle =>
do { open my $fh, $arg or die "cant open ics: $!"; $fh }
)->to_xml;
use Text::vFile::asData; # to make the functional example work
my $data =
Text::vFile::asData->new->parse(
do {
open my $fh, $arg
or die "Cant open vFile: $!"; $fh
}
);
my $c = Text::vFile::toXML->new(data => $data)->to_xml;
# Use functional interface
my $d = to_xml($data);
# Now ($a, $b, $c, $d) all contain the same XML string.
<<lessSYNOPSIS
This module converts iCalendar (iCal : generically, vFile) files into their (equivalent) XML (xCalendar / xCal) representation, according to Royers IETF Draft (http://tools.ietf.org/html/draft-royer-calsch-xcal-03).
# Enable functional interface
use Text::vFile::toXML qw(to_xml);
# Input filename
my $arg = "input.file";
my $a = Text::vFile::toXML->new(filename => $arg)->to_xml;
my $b = Text::vFile::toXML->new(filehandle =>
do { open my $fh, $arg or die "cant open ics: $!"; $fh }
)->to_xml;
use Text::vFile::asData; # to make the functional example work
my $data =
Text::vFile::asData->new->parse(
do {
open my $fh, $arg
or die "Cant open vFile: $!"; $fh
}
);
my $c = Text::vFile::toXML->new(data => $data)->to_xml;
# Use functional interface
my $d = to_xml($data);
# Now ($a, $b, $c, $d) all contain the same XML string.
Download (0.005MB)
Added: 2007-08-22 License: Perl Artistic License Price:
793 downloads
Text::XLogfile 0.03
Text::XLogfile module allows reading and writing xlogfiles. more>>
Text::XLogfile module allows reading and writing xlogfiles.
SYNOPSIS
use Text::XLogfile :all;
my @scores = read_xlogfile("scores.xlogfile");
for (@scores) { $_->{player} = lc $_->{player} }
write_xlogfile(@scores, "scores.xlogfile.new");
my $xlogline = make_xlogline($scores[0], -1);
my $score = parse_xlogline($xlogline);
print "First place: $score->{player}n";
print "$xloglinen";
xlogfile format
xlogfile is a simple line-based data format. An xlogfile is analogous to an array of hashes. Each line corresponds to a hash. A sample xlogline looks like:
name=Eidolos:ascended=1:role=Wiz:race=Elf:gender=Mal:align=Cha
This obviously corresponds to the following hash:
{
ascended => 1,
align => Cha,
name => Eidolos,
race => Elf,
role => Wiz,
gender => Mal,
}
xlogfile supports no quoting. Keys and values may be any non-colon characters. The first = separates the key from the value (so in a=b=c, the key is a, and the value is b=c. Colons are usually transliterated to underscores. Like a Perl hash, if multiple values have the same key, later values will overwrite earlier values. Heres something resembling the actual grammar:
xlogfile<<less
SYNOPSIS
use Text::XLogfile :all;
my @scores = read_xlogfile("scores.xlogfile");
for (@scores) { $_->{player} = lc $_->{player} }
write_xlogfile(@scores, "scores.xlogfile.new");
my $xlogline = make_xlogline($scores[0], -1);
my $score = parse_xlogline($xlogline);
print "First place: $score->{player}n";
print "$xloglinen";
xlogfile format
xlogfile is a simple line-based data format. An xlogfile is analogous to an array of hashes. Each line corresponds to a hash. A sample xlogline looks like:
name=Eidolos:ascended=1:role=Wiz:race=Elf:gender=Mal:align=Cha
This obviously corresponds to the following hash:
{
ascended => 1,
align => Cha,
name => Eidolos,
race => Elf,
role => Wiz,
gender => Mal,
}
xlogfile supports no quoting. Keys and values may be any non-colon characters. The first = separates the key from the value (so in a=b=c, the key is a, and the value is b=c. Colons are usually transliterated to underscores. Like a Perl hash, if multiple values have the same key, later values will overwrite earlier values. Heres something resembling the actual grammar:
xlogfile<<less
Download (0.022MB)
Added: 2007-08-22 License: Perl Artistic License Price:
793 downloads
Text::Ngrams 1.9
Text::Ngrams is a flexible Ngram analysis (for characters, words, and more). more>>
Text::Ngrams is a flexible Ngram analysis (for characters, words, and more).
SYNOPSIS
For default character n-gram analysis of string:
use Text::Ngrams;
my $ng3 = Text::Ngrams->new;
$ng3->process_text(abcdefg1235678hijklmnop);
print $ng3->to_string;
my @ngramsarray = $ng3->get_ngrams;
One can also feed tokens manually:
use Text::Ngrams;
my $ng3 = Text::Ngrams->new;
$ng3->feed_tokens(a);
$ng3->feed_tokens(b);
$ng3->feed_tokens(c);
$ng3->feed_tokens(d);
$ng3->feed_tokens(e);
$ng3->feed_tokens(f);
$ng3->feed_tokens(g);
$ng3->feed_tokens(h);
We can choose n-grams of various sizes, e.g.:
my $ng = Text::Ngrams->new( windowsize => 6 );
or different types of n-grams, e.g.:
my $ng = Text::Ngrams->new( type => byte );
my $ng = Text::Ngrams->new( type => word );
my $ng = Text::Ngrams->new( type => utf8 );
To process a list of files:
$ng->process_files(somefile.txt, otherfile.txt);
This module implement text n-gram analysis, supporting several types of analysis, including character and word n-grams.
The module Text::Ngrams is very flexible. For example, it allows a user to manually feed a sequence of any tokens. It handles several types of tokens (character, word), and also allows a lot of flexibility in automatic recognition and feed of tokens and the way they are combined in an n-gram. It counts all n-gram frequencies up to the maximal specified length. The output format is meant to be pretty much human-readable, while also loadable by the module.
The module can be used from the command line through the script ngrams.pl provided with the package.
Version restrictions:
- If a user customizes a type, it is possible that a resulting n-gram will be ambiguous. In this way, to different n-grams may be counted as one. With predefined types of n-grams, this should not happen. For example, if a user chooses that a token can contain a space, and uses space as an n-gram separator, then a trigram like this "x x x x" is ambiguous.
- Method process_file does not handle multi-line tokens by default. This can be fixed, but it does not seem to be worth the code complication. There are various ways around this if one really needs such tokens: One way is to preprocess them. Another way is to read as much text as necessary at a time then to use process_text, which does handle multi-line tokens.
<<lessSYNOPSIS
For default character n-gram analysis of string:
use Text::Ngrams;
my $ng3 = Text::Ngrams->new;
$ng3->process_text(abcdefg1235678hijklmnop);
print $ng3->to_string;
my @ngramsarray = $ng3->get_ngrams;
One can also feed tokens manually:
use Text::Ngrams;
my $ng3 = Text::Ngrams->new;
$ng3->feed_tokens(a);
$ng3->feed_tokens(b);
$ng3->feed_tokens(c);
$ng3->feed_tokens(d);
$ng3->feed_tokens(e);
$ng3->feed_tokens(f);
$ng3->feed_tokens(g);
$ng3->feed_tokens(h);
We can choose n-grams of various sizes, e.g.:
my $ng = Text::Ngrams->new( windowsize => 6 );
or different types of n-grams, e.g.:
my $ng = Text::Ngrams->new( type => byte );
my $ng = Text::Ngrams->new( type => word );
my $ng = Text::Ngrams->new( type => utf8 );
To process a list of files:
$ng->process_files(somefile.txt, otherfile.txt);
This module implement text n-gram analysis, supporting several types of analysis, including character and word n-grams.
The module Text::Ngrams is very flexible. For example, it allows a user to manually feed a sequence of any tokens. It handles several types of tokens (character, word), and also allows a lot of flexibility in automatic recognition and feed of tokens and the way they are combined in an n-gram. It counts all n-gram frequencies up to the maximal specified length. The output format is meant to be pretty much human-readable, while also loadable by the module.
The module can be used from the command line through the script ngrams.pl provided with the package.
Version restrictions:
- If a user customizes a type, it is possible that a resulting n-gram will be ambiguous. In this way, to different n-grams may be counted as one. With predefined types of n-grams, this should not happen. For example, if a user chooses that a token can contain a space, and uses space as an n-gram separator, then a trigram like this "x x x x" is ambiguous.
- Method process_file does not handle multi-line tokens by default. This can be fixed, but it does not seem to be worth the code complication. There are various ways around this if one really needs such tokens: One way is to preprocess them. Another way is to read as much text as necessary at a time then to use process_text, which does handle multi-line tokens.
Download (0.036MB)
Added: 2007-08-22 License: Perl Artistic License Price:
802 downloads
Text::WikiFormat 0.79
Text::WikiFormat is a Perl module for translating Wiki formatted text into other formats. more>>
Text::WikiFormat is a Perl module for translating Wiki formatted text into other formats.
SYNOPSIS
use Text::WikiFormat;
my $html = Text::WikiFormat::format($raw);
The original Wiki web site had a very simple interface to edit and to add pages. Its formatting rules are simple and easy to use. They are also easy to translate into other, more complicated markup languages with this module. It creates HTML by default, but can produce valid POD, DocBook, XML, or any other format imaginable.
The most important function is format(). It is not exported by default.
format()
format() takes one required argument, the text to convert, and returns the converted text. It allows two optional arguments. The first is a reference to a hash of tags. Anything passed in here will override the default tag behavior. The second argument is a hash reference of options. They are currently:
prefix
The prefix of any links. In HTML mode, this is the path to the Wiki. The actual linked item itself will be appended to the prefix. This is useful to create full URIs:
{ prefix => http://example.com/wiki.pl?page= }
extended
A boolean flag, false by default, to use extended linking semantics. This comes from the Everything Engine (http://everydevel.com/), which marks links with square brackets. An optional title may occur after the link target, preceded by an open pipe. These are valid extended links:
[a valid link]
[link|title]
Where the linking semantics of the destination format allow it, the result will display the title instead of the URI. In HTML terms, the title is the content of an A element (not the content of its HREF attribute).
You can use delimiters other than single square brackets for marking extended links by passing a value for extended_link_delimiters in the %tags hash when calling format.
implicit_links
A boolean flag, true by default, to create links from StudlyCapsStringsNote that if you disable this flag, you should probably enable the extended one also, or there will be no way of creating links in your documents. To disable it, use the pair:
{ implicit_links => 0 }
absolute_links
A boolean flag, false by default, which treats any links that are absolute URIs (such as http://www.cpan.org/) specially. Any prefix will not apply and the URIs arent quoted. Use this in conjunction with the extended option to detect the link.
A link is any text that starts with a known schema followed by a colon and one or more non-whitespace characters. This is a distinct subset of what URI recognizes as a URI, but is a good first-order approximation. If you need to recognize more complex URIs, use the standard wiki formatting explained earlier.
The recognized schemas are those defined in the schema value in the %tags hash. The defaults are http, https, ftp, mailto, and gopher.
<<lessSYNOPSIS
use Text::WikiFormat;
my $html = Text::WikiFormat::format($raw);
The original Wiki web site had a very simple interface to edit and to add pages. Its formatting rules are simple and easy to use. They are also easy to translate into other, more complicated markup languages with this module. It creates HTML by default, but can produce valid POD, DocBook, XML, or any other format imaginable.
The most important function is format(). It is not exported by default.
format()
format() takes one required argument, the text to convert, and returns the converted text. It allows two optional arguments. The first is a reference to a hash of tags. Anything passed in here will override the default tag behavior. The second argument is a hash reference of options. They are currently:
prefix
The prefix of any links. In HTML mode, this is the path to the Wiki. The actual linked item itself will be appended to the prefix. This is useful to create full URIs:
{ prefix => http://example.com/wiki.pl?page= }
extended
A boolean flag, false by default, to use extended linking semantics. This comes from the Everything Engine (http://everydevel.com/), which marks links with square brackets. An optional title may occur after the link target, preceded by an open pipe. These are valid extended links:
[a valid link]
[link|title]
Where the linking semantics of the destination format allow it, the result will display the title instead of the URI. In HTML terms, the title is the content of an A element (not the content of its HREF attribute).
You can use delimiters other than single square brackets for marking extended links by passing a value for extended_link_delimiters in the %tags hash when calling format.
implicit_links
A boolean flag, true by default, to create links from StudlyCapsStringsNote that if you disable this flag, you should probably enable the extended one also, or there will be no way of creating links in your documents. To disable it, use the pair:
{ implicit_links => 0 }
absolute_links
A boolean flag, false by default, which treats any links that are absolute URIs (such as http://www.cpan.org/) specially. Any prefix will not apply and the URIs arent quoted. Use this in conjunction with the extended option to detect the link.
A link is any text that starts with a known schema followed by a colon and one or more non-whitespace characters. This is a distinct subset of what URI recognizes as a URI, but is a good first-order approximation. If you need to recognize more complex URIs, use the standard wiki formatting explained earlier.
The recognized schemas are those defined in the schema value in the %tags hash. The defaults are http, https, ftp, mailto, and gopher.
Download (0.028MB)
Added: 2007-08-22 License: Perl Artistic License Price:
793 downloads
Text::Refer 1.106
Text::Refer can parse Unix refer files. more>>
Text::Refer can parse Unix "refer" files.
SYNOPSIS
Pull in the module:
use Text::Refer;
Parse a refer stream from a filehandle:
while ($ref = input Text::Refer *FH) {
# ...do stuff with $ref...
}
defined($ref) or die "error parsing input";
Same, but using a parser object for more control:
# Create a new parser:
$parser = new Text::Refer::Parser LeadWhite=>KEEP;
# Parse:
while ($ref = $parser->input(*FH)) {
# ...do stuff with $ref...
}
defined($ref) or die "error parsing input";
Manipulating reference objects, using high-level methods:
# Get the title, author, etc.:
$title = $ref->title;
@authors = $ref->author; # list context
$lastAuthor = $ref->author; # scalar context
# Set the title and authors:
$ref->title("Cyberiad");
$ref->author(["S. Trurl", "C. Klapaucius"]); # arrayref for >1 value!
# Delete the abstract:
$ref->abstract(undef);
Same, using low-level methods:
# Get the title, author, etc.:
$title = $ref->get(T);
@authors = $ref->get(A); # list context
$lastAuthor = $ref->get(A); # scalar context
# Set the title and authors:
$ref->set(T, "Cyberiad");
$ref->set(A, "S. Trurl", "C. Klapaucius");
# Delete the abstract:
$ref->set(X); # sets to empty array of values
Output:
print $ref->as_string;
<<lessSYNOPSIS
Pull in the module:
use Text::Refer;
Parse a refer stream from a filehandle:
while ($ref = input Text::Refer *FH) {
# ...do stuff with $ref...
}
defined($ref) or die "error parsing input";
Same, but using a parser object for more control:
# Create a new parser:
$parser = new Text::Refer::Parser LeadWhite=>KEEP;
# Parse:
while ($ref = $parser->input(*FH)) {
# ...do stuff with $ref...
}
defined($ref) or die "error parsing input";
Manipulating reference objects, using high-level methods:
# Get the title, author, etc.:
$title = $ref->title;
@authors = $ref->author; # list context
$lastAuthor = $ref->author; # scalar context
# Set the title and authors:
$ref->title("Cyberiad");
$ref->author(["S. Trurl", "C. Klapaucius"]); # arrayref for >1 value!
# Delete the abstract:
$ref->abstract(undef);
Same, using low-level methods:
# Get the title, author, etc.:
$title = $ref->get(T);
@authors = $ref->get(A); # list context
$lastAuthor = $ref->get(A); # scalar context
# Set the title and authors:
$ref->set(T, "Cyberiad");
$ref->set(A, "S. Trurl", "C. Klapaucius");
# Delete the abstract:
$ref->set(X); # sets to empty array of values
Output:
print $ref->as_string;
Download (0.031MB)
Added: 2007-08-22 License: Perl Artistic License Price:
794 downloads
Text::Yats 0.03
Text::Yats is Yet Another Template System. more>>
Text::Yats is Yet Another Template System.
SYNOPSIS
use Text::Yats;
my $template = < < ENDHTML;
< html >
< head >
< title >$title - $version< /title >
< /head >
< body >
< form >
< select name="names" >< !--{1}-- >
< option $selected >$list< /option >
< !--{2}-- >< /select >
< /form >
< /body >
< /html >
ENDHTML
my $result = "";
my $tpl = Text::Yats- >new(
level = > 1,
text = > $template);
$result .= $tpl- >section- >[0]- >replace(
title = > "Yats",
version = > "Development", );
$result .= $tpl- >section- >[1]- >replace(
list = > [hdias,anita,cubitos],
selected = > { value = > "selected",
array = > "list",
match = > "anita", } );
$result .= $tpl- >section- >[2]- >text;
print $result;
<<lessSYNOPSIS
use Text::Yats;
my $template = < < ENDHTML;
< html >
< head >
< title >$title - $version< /title >
< /head >
< body >
< form >
< select name="names" >< !--{1}-- >
< option $selected >$list< /option >
< !--{2}-- >< /select >
< /form >
< /body >
< /html >
ENDHTML
my $result = "";
my $tpl = Text::Yats- >new(
level = > 1,
text = > $template);
$result .= $tpl- >section- >[0]- >replace(
title = > "Yats",
version = > "Development", );
$result .= $tpl- >section- >[1]- >replace(
list = > [hdias,anita,cubitos],
selected = > { value = > "selected",
array = > "list",
match = > "anita", } );
$result .= $tpl- >section- >[2]- >text;
print $result;
Download (0.005MB)
Added: 2007-08-10 License: Perl Artistic License Price:
805 downloads
Text::MicroMason::Mason 1.96.0
Text::MicroMason::Mason is a simple compiler for Mason-style Templating. more>>
Text::MicroMason::Mason is a simple compiler for Mason-style Templating.
SYNOPSIS
Mason syntax provides several ways to mix Perl into a text template:
< %args >
$name
< /%args >
% if ( $name eq Dave ) {
Im sorry < % $name % >, Im afraid I cant do that right now.
% } else {
< %perl >
my $hour = (localtime)[2];
my $daypart = ( $hour > 11 ) ? afternoon : morning;
< /%perl >
Good < % $daypart % >, < % $name % >!
% }
< & "includes/standard_footer.msn" & >
< %doc >
Heres a private developr comment describing this template.
< /%doc >
Create a Mason object to interpret the templates:
use Text::MicroMason;
my $mason = Text::MicroMason->new();
You can compile and execute templates using the standard MicroMason methods:
$coderef = $mason->compile( file => simple.tmpl );
print $coderef->( %arguments );
print $mason->execute( file => simple.tmpl, %arguments );
Main features:
- Template interpolation with
- Literal Perl lines with leading %
- Named %args, %perl, %once, %init, %cleanup, and %doc blocks
- The $m mason object, although with many fewer methods
- Expression filtering with |h and |u (via -Filter mixin)
<<lessSYNOPSIS
Mason syntax provides several ways to mix Perl into a text template:
< %args >
$name
< /%args >
% if ( $name eq Dave ) {
Im sorry < % $name % >, Im afraid I cant do that right now.
% } else {
< %perl >
my $hour = (localtime)[2];
my $daypart = ( $hour > 11 ) ? afternoon : morning;
< /%perl >
Good < % $daypart % >, < % $name % >!
% }
< & "includes/standard_footer.msn" & >
< %doc >
Heres a private developr comment describing this template.
< /%doc >
Create a Mason object to interpret the templates:
use Text::MicroMason;
my $mason = Text::MicroMason->new();
You can compile and execute templates using the standard MicroMason methods:
$coderef = $mason->compile( file => simple.tmpl );
print $coderef->( %arguments );
print $mason->execute( file => simple.tmpl, %arguments );
Main features:
- Template interpolation with
- Literal Perl lines with leading %
- Named %args, %perl, %once, %init, %cleanup, and %doc blocks
- The $m mason object, although with many fewer methods
- Expression filtering with |h and |u (via -Filter mixin)
Download (0.046MB)
Added: 2007-08-09 License: Perl Artistic License Price:
806 downloads
Text::MicroMason::HTMLMason 1.992
Text::MicroMason::HTMLMason is a simple compiler for Mason-style Templating. more>>
Text::MicroMason::HTMLMason is a simple compiler for Mason-style Templating.
SYNOPSIS
Create a MicroMason object to interpret the templates:
use Text::MicroMason;
my $mason = Text::MicroMason->new();
Use the standard compile and execute methods to parse and evalute templates:
print $mason->compile( text=>$template )->( @%args );
print $mason->execute( text=>$template, @args );
Mason syntax provides several ways to mix Perl into a text template:
< %args >
$name
< /%args >
% if ( $name eq Dave ) {
Im sorry < % $name % >, Im afraid I cant do that right now.
% } else {
< %perl >
my $hour = (localtime)[2];
my $daypart = ( $hour > 11 ) ? afternoon : morning;
< /%perl >
Good < % $daypart % >, < % $name % >!
% }
< & "includes/standard_footer.msn" & >
< %doc >
Heres a private developr comment describing this template.
< /%doc >
Main features:
- Template interpolation with
- Literal Perl lines with leading %
- Named %args, %perl, %once, %init, %cleanup, and %doc blocks
- The $m mason object, although with many fewer methods
- Expression filtering with |h and |u (via -Filter mixin)
<<lessSYNOPSIS
Create a MicroMason object to interpret the templates:
use Text::MicroMason;
my $mason = Text::MicroMason->new();
Use the standard compile and execute methods to parse and evalute templates:
print $mason->compile( text=>$template )->( @%args );
print $mason->execute( text=>$template, @args );
Mason syntax provides several ways to mix Perl into a text template:
< %args >
$name
< /%args >
% if ( $name eq Dave ) {
Im sorry < % $name % >, Im afraid I cant do that right now.
% } else {
< %perl >
my $hour = (localtime)[2];
my $daypart = ( $hour > 11 ) ? afternoon : morning;
< /%perl >
Good < % $daypart % >, < % $name % >!
% }
< & "includes/standard_footer.msn" & >
< %doc >
Heres a private developr comment describing this template.
< /%doc >
Main features:
- Template interpolation with
- Literal Perl lines with leading %
- Named %args, %perl, %once, %init, %cleanup, and %doc blocks
- The $m mason object, although with many fewer methods
- Expression filtering with |h and |u (via -Filter mixin)
Download (0.068MB)
Added: 2007-08-09 License: Perl Artistic License Price:
807 downloads
Text::Diff 0.35
Text::Diff can perform diffs on files and record sets. more>>
Text::Diff can perform diffs on files and record sets.
SYNOPSIS
use Text::Diff;
## Mix and match filenames, strings, file handles, producer subs,
## or arrays of records; returns diff in a string.
## WARNING: can return B diffs for large files.
my $diff = diff "file1.txt", "file2.txt", { STYLE => "Context" };
my $diff = diff $string1, $string2, %options;
my $diff = diff *FH1, *FH2;
my $diff = diff &reader1, &reader2;
my $diff = diff @records1, @records2;
## May also mix input types:
my $diff = diff @records1, "file_B.txt";
diff() provides a basic set of services akin to the GNU diff utility. It is not anywhere near as feature complete as GNU diff, but it is better integrated with Perl and available on all platforms. It is often faster than shelling out to a systems diff executable for small files, and generally slower on larger files.
Relies on Algorithm::Diff for, well, the algorithm. This may not produce the same exact diff as a systems local diff executable, but it will be a valid diff and comprehensible by patch. We havent seen any differences between Algorithm::Diffs logic and GNU diffs, but we have not examined them to make sure they are indeed identical.
Note: If you dont want to import the diff function, do one of the following:
use Text::Diff ();
require Text::Diff;
Thats a pretty rare occurence, so diff() is exported by default.
<<lessSYNOPSIS
use Text::Diff;
## Mix and match filenames, strings, file handles, producer subs,
## or arrays of records; returns diff in a string.
## WARNING: can return B diffs for large files.
my $diff = diff "file1.txt", "file2.txt", { STYLE => "Context" };
my $diff = diff $string1, $string2, %options;
my $diff = diff *FH1, *FH2;
my $diff = diff &reader1, &reader2;
my $diff = diff @records1, @records2;
## May also mix input types:
my $diff = diff @records1, "file_B.txt";
diff() provides a basic set of services akin to the GNU diff utility. It is not anywhere near as feature complete as GNU diff, but it is better integrated with Perl and available on all platforms. It is often faster than shelling out to a systems diff executable for small files, and generally slower on larger files.
Relies on Algorithm::Diff for, well, the algorithm. This may not produce the same exact diff as a systems local diff executable, but it will be a valid diff and comprehensible by patch. We havent seen any differences between Algorithm::Diffs logic and GNU diffs, but we have not examined them to make sure they are indeed identical.
Note: If you dont want to import the diff function, do one of the following:
use Text::Diff ();
require Text::Diff;
Thats a pretty rare occurence, so diff() is exported by default.
Download (0.015MB)
Added: 2007-08-09 License: Perl Artistic License Price:
493 downloads
Text::Indent 0.1
Text::Indent is a simple indentation of text shared among modules. more>>
Text::Indent is a simple indentation of text shared among modules.
SYNOPSIS
In your main program:
use Text::Indent;
my $indent = Text::Indent->new;
$indent->spaces(2);
In a module to produce indented output:
use Text::Indent;
my $indent = Text::Indent->instance;
$indent->increase;
print $indent->indent("this will be indented two spaces");
$indent->increase(2);
print $indent->indent("this will be indented six spaces");
$indent->decrease(3);
Text::Indent is designed for use in programs which need to produce output with multiple levels of indent when the source of the output comes from different modules that know nothing about each other.
For example take module A, whose output includes the indented output of module B. Module B can also produce output directly, so it falls to module B to know whether it should indent its output or not depending on its calling context.
Text::Indent allows programs and modules to cooperate to choose an appropriate indent level that is shared within the program context. In the above example, module A would increase the indent level prior to calling the output routines of module B. Module B would simply use the Text::Indent instance confident that if it were being called directly no indent would be applied but if module A was calling it then its output would be indented one level.
<<lessSYNOPSIS
In your main program:
use Text::Indent;
my $indent = Text::Indent->new;
$indent->spaces(2);
In a module to produce indented output:
use Text::Indent;
my $indent = Text::Indent->instance;
$indent->increase;
print $indent->indent("this will be indented two spaces");
$indent->increase(2);
print $indent->indent("this will be indented six spaces");
$indent->decrease(3);
Text::Indent is designed for use in programs which need to produce output with multiple levels of indent when the source of the output comes from different modules that know nothing about each other.
For example take module A, whose output includes the indented output of module B. Module B can also produce output directly, so it falls to module B to know whether it should indent its output or not depending on its calling context.
Text::Indent allows programs and modules to cooperate to choose an appropriate indent level that is shared within the program context. In the above example, module A would increase the indent level prior to calling the output routines of module B. Module B would simply use the Text::Indent instance confident that if it were being called directly no indent would be applied but if module A was calling it then its output would be indented one level.
Download (0.005MB)
Added: 2007-08-08 License: Perl Artistic License Price:
807 downloads
Secleted [ 0 ] software to compare
Copyright Notice:
Software piracy is theft, Using crack, password, serial numbers, registration codes, key generators is illegal and prevent future software development. The above predictive text search only lists software in full, demo and trial versions for free download. Download links are directly from our mirror sites or publisher sites, torrent files or links from rapidshare.com, yousendit.com or megaupload.com are not allowed
Contact Us | Submit Software | Advertise with us | Terms and Conditions | Privacy Policy | Publisher List | Browse Categories | Blog | Discussion Board
Copyright (c)2005-2009 WareSeeker.com. All rights reserved.
Copyright (c)2005-2009 WareSeeker.com. All rights reserved.