Test::S...r::Meta(3)

πŸ“¦
version 1.302027 Β· 2 versions
, in fedora 43

✨ NAME ✨

Test::Stream::Exporter::Meta β€” the meta object for exporters. It's giving "an object that manages objects" energy and honestly? Main character behavior πŸ‘‘

Also hi, this is the Test::S...r::Meta(3) page, straight out of the User Contributed Perl Documentation corner of the manual, so you know it's community-made and cute πŸ’…


πŸ’€ DEPRECATED πŸ’€

Okay bestie, important thing first, no cap: this distribution is deprecated. Not deprecated into the void, but deprecated in favor of Test2, Test2::Suite, and Test2::Workflow. So if you're starting something new, that's where you should be, fr fr.

There is a whole conversion guide waiting for you in Test::Stream::Manual::ToTest2 if you need to migrate. Go read it, it's literally right there 🫢


🌸 DESCRIPTION 🌸

So here's the whole vibe: Test::Stream::Exporter uses this package to manage exports. Every package that uses Test::Stream::Exporter gets a Test::Stream::Exporter::Meta object created just for it, and that object holds the metadata about which exports are available and what kind of export each one is. It's the backstage manager of your export situation πŸŽ€


πŸ”₯ FUNCTIONS πŸ”₯

  • $meta = Test::Stream::Exporter::Meta::get( $PACKAGE ) β€” hands you the metaobject for $PACKAGE if one exists, and undef if it doesn't (sad, I know 😭). You can call it as either a method or a function, doesn't matter which β€” only the last argument is ever used, everything else is just there for decoration.

πŸ’… METHODS πŸ’…

  • $meta = Test::Stream::Exporter::Meta->new( $PACKAGE ) β€” constructs a metaobject for $PACKAGE and returns it. And if one already exists? It just returns that one instead. Efficient queen ✨
  • $meta->add( $DEFAULT, $SUBNAME )
  • $meta->add( $DEFAULT, $SUBNAME => $SUBREF ) β€” adds an export named $SUBNAME. If you pass in a ref, that ref is what gets used; if you don't, it goes and grabs the sub from the package using $SUBNAME. The first argument is a toggle: true means the sub is exported by default, false means it is not exported by default. Simple as that.
  • $meta->add_bulk( $DEFAULT, $SUBNAME, $SUBNAME, ... ) β€” adds every subname you list as an argument to the list of exports, all at once, bulk girly πŸ“ The subs with those given names get taken as the references. The first argument is the toggle again: true means the subs should be exported by default, false means they should not be.
  • $default_ref = $meta->default() β€” gives you the arrayref of default exports. ⚠️ But heads up: this is not a copy. If you modify it, you're modifying the internal list of defaults directly. Be gentle with it, okay?
  • $exports_ref = $meta->exports() β€” returns a HASHREF of $SUBNAME => $CODEREF values for all the available exports. Every single one, in one cute little hash πŸ”₯

πŸ¦‹ SOURCE πŸ¦‹

The source code repository for Test::Stream lives at http://github.com/Test-More/Test-Stream/. Go lurk, go read the code, go star it πŸ’œ


πŸ‘‘ MAINTAINERS πŸ‘‘

  • Chad Granum <exodist@cpan.org>

🌈 AUTHORS 🌈

  • Chad Granum <exodist@cpan.org>
  • Kent Fredric <kentnl@cpan.org>

Copyright 2015 Chad Granum <exodist7@gmail.com>.

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

See http://dev.perl.org/licenses/


and that's the whole page, bestie πŸ’– this was perl v5.42.0, dated 2025-07-25, signing off 🫢✨

πŸ“¦ where this page comes from