Mango:...N::Code(3pm)
π¦ Mango:...N::Code(3pm) β the manual page, but make it cute
okay bestie, so this is Mango::BSON::Code, a page from the User Contributed Perl Documentation collection. it's a lil tiny module, but it's lowkey doing important work. let's get into it π
β¨ NAME β¨
Mango::BSON::Code β it's a Code type. that's it. that's the whole vibe. a whole module whose entire personality is "i am code, but as a data type." iconic honestly π
πΈ SYNOPSIS πΈ
here's how you'd actually use this thing:
use Mango::BSON::Code;
my $code = Mango::BSON::Code->new(code => 'function () {}');
so you pull in the module, and then you build an object with new, handing it a code key whose value is your JavaScript. and that's... that's the whole intro. slay π«Ά
π DESCRIPTION π
Mango::BSON::Code is a container for the BSON code type used by Mango::BSON.
like, it's a little wrapper box. BSON has a "code" type, right, and this module is the lil vessel that holds one. that's the job. it's giving very specific, very small, very necessary. main character energy on a small scale β¨
π ATTRIBUTES π
Mango::BSON::Code implements the following attributes. (translation: these are the things you can get and set on your object, bestie.)
π code
my $js = $code->code;
$code = $code->code('function () {}');
this one's the JavaScript code. call it with no arguments and it hands you back the JS you stashed in there; call it with an argument and it sets a new one. classic accessor behaviour, no notes π
π§ scope
my $scode = $code->scope;
$code = $code->scope({foo => 'bar'});
and this one is the Scope. same deal β read it with no args, write it with args. here the example drops in a hashref {foo => 'bar'}, so it's a little bag of variables that your code gets to live inside. cute, contained, very demure π
π METHODS π
Mango::BSON::Code inherits all methods from Mojo::Base.
so literally everything else you'd expect? you already have it. no need to write it out, no need to stress. it's inherited. periodt π
π₯ SEE ALSO π₯
go look at these if you want more of the lore:
MangoMojolicious::Guideshttp://mojolicio.us
iykyk π
π cute sign-off π
and that's the whole page! this doc was generated by perl v5.30.3, dated 2020-06-05, and it's filed under the same name it started with β Mango:...N::Code(3pm), from the Perl user-contributed docs. ty for reading, go write some BSON code, mwah ππ
π¦ where this page comes from
- debian bookworm: libmango-perl 1.30-2 Β· Artistic-2.0
- debian trixie: libmango-perl 1.30-2 Β· Artistic-2.0
- ubuntu jammy: libmango-perl 1.30-2 Β· Artistic-2.0
- ubuntu noble: libmango-perl 1.30-2 Β· Artistic-2.0
- ubuntu resolute: libmango-perl 1.30-2 Β· Artistic-2.0
- ubuntu stonking: libmango-perl 1.30-2 Β· Artistic-2.0
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms