Text::Lorem::More - Generate formatted nonsense using random Latin words.
Version 0.13
Generate formatted nonsense using random Latin words.
use Text::Lorem::More; my $lorem = Text::Lorem::More->new; # Greet a friend print "Hello, ", $lorem->fullname, "\n"; # You could also ... print $lorem->process("Hello, +fullname\n"); ... or you can use the singleton: use Text::Lorem::More qw(lorem); # Generate a random latin word my $latinwordoftheday = lorem->word; # Produce paragaphs in the Text::Lorem compatible manner my $content = lorem->paragraphs(3); # Print 4 paragraphs, each separated by a single newline and tab: print "\t", scalar lorem->paragraph(4, "\n\t");
To use a generator, call the method with the same name as the generator, To use the name generator, for example:
my $name = $lorem->name;
Alternatively, you can use the generate or process functions. To use the hostname generator, for example:
generate
process
my $hostname = $lorem->hostname; # This will do the same thing ... my $otherhostname = $lorem->generate("+hostname");
Generates random latin word.
dicta sed repellat
Generates between 4 and 9 words, with the first letter of the first word capitalized and a period following the last word.
Generates between 3 and 6 sentences,
A Text::Lorem compatible words generator. Will generate $count words joined by " ".
A Text::Lorem compatible sentences generator. Will generate $count sentences joined by " ". Each sentence contains between 4 and 9 words and ends with a period. Passing in 0 for count will still produce a single period!
A Text::Lorem compatible sentences generator. Will generate $count paragraphs joined by "\n\n". Each paragraph contains between 3 and 6 sentences.
Generates a random latin word with the first letter capitalized
Repellat Sed Ipsum
Generates a firstname and lastname separated by a space
Lorem Dicta
Generates a random latin word
Generates between 1 and 3 words with the first letter of the first word capitalized
Generates between 1 and 3 sentences.
Generates a top level domain. Currently, this will either be "com", "org", or "net".
Generates a domainname. Currently, this will attach "example" to a tld generator result.
example.com example.net
Generates a hostname. Currently, this will either return a plain domainname, as above, or attach a latin word to a domainname result.
et.example.com example.org
Construct a new Text::Lorem::More object
Generate some text using the specified pattern.
generate is faster than process, as generate uses regex to perform substitution.
In list context, return a list with $count number of "words"
$count
In scalar context, return $pattern repeated $count times and joined by $separator.
$pattern
$separator
If you do not specify scalar context on the receiving end, then the separator will simply be discarded. This may change in the future
The default for $count is 1.
The default for $separator is " ".
A pattern will usually contain one or more generator tokens. For example:
+name +fullname +word+word+word+word
The pattern can also contain other text:
+name@+domainname "+firstname +lastname"
Sometimes you might need to enclose the token identifier between +{ and }
+{
}
For example, the following pattern won't work right:
prefix+namesuffix
But this will:
prefix+{name}suffix
If you need to include a '+' in your pattern, you'll have to use process instead.
Process a block of text, performing pattern substitutions as they're found.
process is slower than generate, as process uses Parse::RecDescent.
To escape '+', simply repeat it. For example, to produce "2 + 2" you would submit:
2 ++ 2
Please see generate for more information.
Return the generator source for this instance.
A Text::Lorem::More singleton.
Robert Krimen, <robertkrimen at gmail.com>
<robertkrimen at gmail.com>
Text::Lorem
WWW::Lipsum
http://lipsum.com/
You can contribute or fork this project via GitHub:
http://github.com/robertkrimen/text-lorem-more/tree/master
git clone git://github.com/robertkrimen/text-lorem-more.git Text-Lorem-More
Thanks to Adeola Awoyemi for writing Text::Lorem
Copyright 2006 Robert Krimen, all rights reserved.
This program is free software; you can redistribute it and/or modify it under the same terms as Perl itself.
Probaby a lot. Please report them (as below) and I'll take a look.
Please report any bugs or feature requests to bug-text-lorem-more at rt.cpan.org, or through the web interface at http://rt.cpan.org/NoAuth/ReportBug.html?Queue=Text-Lorem-More. I will be notified, and then you'll automatically be notified of progress on your bug as I make changes.
bug-text-lorem-more at rt.cpan.org
You can find documentation for this module with the perldoc command.
perldoc Text::Lorem::More
You can also look for information at:
AnnoCPAN: Annotated CPAN documentation
http://annocpan.org/dist/Text-Lorem-More
CPAN Ratings
http://cpanratings.perl.org/d/Text-Lorem-More
RT: CPAN's request tracker
http://rt.cpan.org/NoAuth/Bugs.html?Dist=Text-Lorem-More
Search CPAN
http://search.cpan.org/dist/Text-Lorem-More
To install Text::Lorem::More, copy and paste the appropriate command in to your terminal.
cpanm
cpanm Text::Lorem::More
CPAN shell
perl -MCPAN -e shell install Text::Lorem::More
For more information on module installation, please visit the detailed CPAN module installation guide.