MetaCP...::HasUA(3pm)
β¨ MetaCP...::HasUA β¨
okay so bestie, welcome to MetaCPAN::Client::Role::HasUA π β aka the role that handles your user-agent situation. It's from the User Contributed Perl Documentation corner of the perl world, and it's lowkey iconic. Let's get into it π«Ά
πΈ VERSION πΈ
version 2.044000 β¨ (yes, that's the whole version number, she's specific)
π ATTRIBUTES π
π
ua
my $mcpan = MetaCPAN::Client->new( ua => HTTP::Tiny->new(...) );
So this is the user agent object that actually goes out there and runs your requests. She's the one doing the work, the main character of the network call π«
The way that it works: it must provide an interface that matches HTTP::Tiny. Like, explicitly, no wiggle room:
- Implement
post()β there has to be apostmethod available that accepts a request URL and a hashref of options. - Implement
get()β there has to be agetmethod available that accepts a request URL. - Return result hashref β it must return a result hashref which has the key
successand the keycontent.
Default: HTTP::Tiny π (she comes pre-installed, we love a no-effort setup)
π ua_args
my $mcpan = MetaCPAN::Client->new(
ua_args => [ agent => 'MyAgent' ],
);
These are the arguments sent to the user agent β like, all the little extras you wanna pass along to her so she knows how to behave π
Default: user agent string: MetaCPAN::Client/$version.
π AUTHORS π
- Sawyer X
<xsawyerx@cpan.org> - Mickey Nasriachi
<mickey@cpan.org>
π COPYRIGHT AND LICENSE π
This software is copyright (c) 2016 by Sawyer X.
This is free software; you can redistribute it and/or modify it under the same terms as the Perl 5 programming language system itself. fr fr, it's free, go wild π¦
ngl bestie, if you're swapping in your ownua, double-check she's gotpost()andget()and returns thatsuccess+contenthashref β otherwise it's giving broken and the request will simply not slay π
perl v5.40.1 Β· 2026-07-05 Β· MetaCP...::HasUA(3pm) β that's the whole vibe, thanks for reading, mwah π β¨π«Ά
π¦ where this page comes from
- ubuntu stonking: libmetacpan-client-perl 2.044000-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