Data::Fake::MetaSyntactic - Fake metasyntactic data generators
use Data::Fake::MetaSyntactic; fake_metatheme()->(); # foo, donmartin, weekdays, etc. fake_metacategory()->(); # foo/fr, donmartin, weekdays/nl, etc. fake_meta()->(); # titi, GING_GOYNG, vrijdag, etc.
This module provides fake data generators for Acme::MetaSyntactic.
All functions are exported by default.
$generator = fake_name( $theme );
Returns a generator that provides a randomly selected item from the given Acme::MetaSyntactic theme.
The theme name can be given in the form theme/category if the correspnding Acme::MetaSyntactic theme supports categories.
theme/category
$theme can be a code reference that returns a theme name when executed.
$theme
If no $theme is given, a random theme is picked for the generator among the installed ones.
$generator = fake_metatheme();
Returns a generator that provides a random Acme::MetaSyntactic theme name, among the installed ones.
$generator = fake_metacategory( $theme );
Returns a generator that provides a random category from an installed Acme::MetaSyntactic theme. The theme itself is a category of its own. The categories returned by the generator can be passed to "fake_meta".
Generate a random item from a given theme:
$generator = fake_meta( $theme );
Generate a random item from a randomly selected theme:
$generator = fake_meta();
Generate a random item from a different random theme each time:
$generator = fake_meta( fake_metatheme() );
All themes have a default category. Since fake_metatheme() returns a generator that only produces theme names, that implies the default category is always used in that case.
fake_metatheme()
Generate a random item from a random category from a given theme:
$generator = fake_meta( fake_metacategory( $theme ) );
Generate a random item from a randomly selected theme, with a random category each time:
$generator = fake_meta( fake_metacategory() );
Generate a random item from a different random theme/category each time:
$generator = fake_meta( fake_metacategory( fake_metatheme() ) );
IRC is one my source of inspiration (actually, the people on it). It seems Acme::MetaSyntactic also inspires sillyness in people:
#perl-qa on 2015-02-03 (UTC times) 04:23 <@xdg> BooK, I invite you to read this talk I gave and then contribute Data::Fake::MetaSyntactic. :-) http://tinyurl.com/pd5agr6 [ http://www.dagolden.com/wp-content/uploads/2009/04/Taking-Your-Perl-to-Eleven.pdf ] 07:14 <@BooK> xdg: but I did Data::Faker::MetaSyntactic already!? 07:35 <@BooK> ooh, different module 08:03 <@BooK> xdg: I love it. will make the module
Data::Fake, Acme::MetaSyntactic, Task::MetaSyntactic.
Philippe Bruhat (BooK), <book@cpan.org>.
Copyright 2015 Philippe Bruhat (BooK), all rights reserved.
This program is free software; you can redistribute it and/or modify it under the same terms as Perl itself.
To install Data::Fake::MetaSyntactic, copy and paste the appropriate command in to your terminal.
cpanm
cpanm Data::Fake::MetaSyntactic
CPAN shell
perl -MCPAN -e shell install Data::Fake::MetaSyntactic
For more information on module installation, please visit the detailed CPAN module installation guide.