Data::...amples(3pm)
π Data::Fake::Examples β the perl manual, but make it cute π
okay bestie, gather round, because this is the manual page for Data::Fake::Examples (that's the 3pm perl doc situation, yes we read those, we're cultured like that) and it's literally just a little scrapbook of how do i actually put these fake-data generators together π§β¨
πΈ NAME πΈ
Data::Fake::Examples β Examples of combining Data::Fake generators
like, not the generators themselves, bestie. the combos. the remixes. the collabs. π
β¨ VERSION β¨
version 0.006
tiny number, big energy π
π₯ EXAMPLES π₯
okay so the author says, and i quote the vibe here: I plan to add additional examples here over time. Contributions are welcome.
which is literally the politest way to say "this page is a work in progress and your pull requests are iconic" π«Ά so if you have a cute generator mashup, send it in.
π URLs π
the goal here is fake URLs that look like this:
# http://example.com/
# https://www.example.com/
# http://www23.example.com/
look at those. so normal. so plausible. nobody would ever suspect a thing π
here's the whole flex:
use Data::Fake qw/Core Internet/;
my $fake_url = fake_template(
"%s://%s%s/",
fake_pick(qw(http https)),
fake_pick( "", "www.", fake_digits("www##.") ),
fake_domain(),
);
the way this works is chef's kiss: fake_template takes a format string "%s://%s%s/" and then you just feed it generators in order, one per %s. so slot one gets a scheme from fake_pick(qw(http https)), slot two gets either nothing, or "www.", or a fake_digits("www##.") situation (that's www plus two digits plus a dot, so like www23.), and slot three gets a fake_domain(). and boom. a whole fake URL, no cap. π₯
reminder bestie: you gotta pull in the right generators, hence theuse Data::Fake qw/Core Internet/;up top.CoreandInternetare the flavour packs here. π
π AUTHOR π
David Golden <dagolden@cpan.org>
the icon. the legend. the moment. π
π COPYRIGHT AND LICENSE π
This software is Copyright (c) 2015 by David Golden.
This is free software, licensed under:
The Apache License, Version 2.0, January 2004
free as in free, bestie. go wild, but read the license, fr fr. πβ¨
and that's the whole page, no notes π¦ this doc came to you courtesy of perl v5.38.2, dated 2024-07-24, so if you're reading this from the future, hi, hope the fake URLs still slay π stay hydrated, format your templates carefully, and remember: every %s needs a generator or it's giving chaos πΈ periodt β¨
π¦ where this page comes from
- debian trixie: libdata-fake-perl 0.006-3 Β· Apache-2.0
- ubuntu resolute: libdata-fake-perl 0.006-3 Β· Apache-2.0
- ubuntu stonking: libdata-fake-perl 0.006-3 Β· Apache-2.0
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms