NAME

Data::Fake::MetaSyntactic - Fake metasyntactic data generators

SYNOPSIS

    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.

DESCRIPTION

This module provides fake data generators for Acme::MetaSyntactic.

All functions are exported by default.

FUNCTIONS

fake_meta

    $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 can be a code reference that returns a theme name when executed.

If no $theme is given, a random theme is picked for the generator among the installed ones.

fake_metatheme

    $generator = fake_metatheme();
 

Returns a generator that provides a random Acme::MetaSyntactic theme name, among the installed ones.

fake_metacategory

    $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".

$theme can be a code reference that returns a theme name when executed.

If no $theme is given, a random theme is picked for the generator among the installed ones.

EXAMPLES

  • 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.

  • 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() ) );

TRIVIA

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

SEE ALSO

Data::Fake, Acme::MetaSyntactic, Task::MetaSyntactic.

AUTHOR

Philippe Bruhat (BooK), <book@cpan.org>.

COPYRIGHT

Copyright 2015 Philippe Bruhat (BooK), all rights reserved.

LICENSE

This program is free software; you can redistribute it and/or modify it under the same terms as Perl itself.