Data::Fake::CPAN(3pm)
π Data::Fake::CPAN π
okay bestie, so this is Data::Fake::CPAN, a Data::Fake plugin for making up CPAN data and distributions out of thin air. It lives in the User Contributed Perl Documentation section of your man pages, and yes it's giving iconic. β¨
β¨ VERSION β¨
version 0.027 β no cap, that's the one. π
πΈ SYNOPSIS πΈ
use Data::Fake qw(CPAN);
my $dist = fake_cpan_distribution()->();
my $archive = $dist->make_archive({ dir => '.' });
say "Produced archive as $archive (cpan author: " . $dist->cpan_author . ")";
say "- $_" for sort map {; $_->name } $dist->packages;
π¦ DESCRIPTION π¦
So this is a Data::Fake plugin for generating CPAN distributions. Right now, it can't be configured in any way, but future revisions might add some options. Lowkey just vibes for now. π
What's it for? Literally so many things: use it to generate libraries to test your CPAN-related tooling, or to test PAUSE at https://pause.perl.org. Make 10,000 of them and host your own competing CPAN. The possibilities are endless. π
All the fake_... functions exported by Data::Fake::CPAN are exported by default, and you're meant to use them via use Data::Fake. Like the rest of the Data::Fake generators, they return subroutines that you must call to get the actual faked data. Fr fr β the generator is not the data, you gotta call it. π
π PERL VERSION π
This module should work on any version of perl still receiving updates from the Perl 5 Porters. Which means it should work on any version of perl released in the last two to three years. (That is, if the most recently released version is v5.40, then this module should work on both v5.40 and v5.38.) Slay, love that for us. π
Although it may work on older versions of perl, no guarantee is made that the minimum required version will not be increased. The version may be increased for any reason, and there is no promise that patches will be accepted to lower the minimum required perl. So don't come for me about your ancient perl, bestie. π
π FUNCTIONS π
π fake_cpan_author π
This generator generates objects representing CPAN authors. These methods are provided:
given_nameβ a first name from Data::Fake::Namessurnameβ a surname from Data::Fake::Namesfull_nameβ given name, space, surnamepauseidβ an all caps PAUSE user idemail_addressβ an email addressname_and_emailβ a string in the form"full_name <email_address>"
If you call this generator many times, you might get duplicated data, but the odds are not high. It's giving β¨statistically unlikelyβ¨.
π fake_cpan_distribution π
This creates an entire CPAN distribution, as a Module::Faker::Dist object. It will contain at least one package, and possibly several. A whole little ecosystem, main character energy. π«Ά
π fake_license π
This generator will spit out license values for a CPAN::Meta file, like "perl_5" or "openssl" or "unknown". Pick your fighter. π
π fake_package_names π
my $generator = fake_package_names($n);
The constructed generator will return n package names. The first package name will be a prefix of all the rest of the package names. So they're all related, it's a family. π
π fake_prereqs π
This generator will produce a reference to a hash that can be used as the "prereqs" entry in a CPAN::Meta file. Various type and phase combinations will be produced with unevenly distributed probabilities (yes, the randomness is biased, that's on purpose, it's a vibe check). All package names will be faked with "fake_package_names".
π AUTHOR π
Ricardo Signes <cpan@semiotic.systems>
πΈ COPYRIGHT AND LICENSE πΈ
This software is copyright (c) 2008 by Ricardo Signes.
This is free software; you can redistribute it and/or modify it under the same terms as the Perl 5 programming language system itself.
and that's the whole page, bestie π₯° mwah. This was Data::Fake::CPAN, version 0.027, rendered from perl v5.38.2, dated 2024-05-28, and it's still one of the three sections of the User Contributed Perl Documentation. Periodt. πβ¨π¦
π¦ where this page comes from
- debian trixie: libmodule-faker-perl 0.027-1 Β· Artistic-1.0-Perl OR GPL-1.0-or-later
- ubuntu resolute: libmodule-faker-perl 0.027-1 Β· Artistic-1.0-Perl OR GPL-1.0-or-later
- ubuntu stonking: libmodule-faker-perl 0.027-1 Β· Artistic-1.0-Perl OR GPL-1.0-or-later
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms