CPANPL...ternals(3pm)

πŸ“¦
version 0.9916 Β· 5 versions
, in debian trixie, ubuntu resolute, ubuntu stonking

πŸ’– CPANPLUS::Internals β€” bestie, this is the CPANPLUS internals πŸ’–

okay so real talk, the manual page you're holding is CPANPL...ternals(3pm) from the User Contributed Perl Documentation crew, and it is the deep-lore page for CPANPLUS::Internals. no cap. it's giving backstage-pass energy. 🎟️✨


πŸ¦‹ SYNOPSIS πŸ¦‹

my $internals   = CPANPLUS::Internals->_init( _conf => $conf );
my $backend     = CPANPLUS::Internals->_retrieve_id( $ID );

that's it. that's the whole vibe check. two lines and you're in. πŸ’…


🌸 DESCRIPTION 🌸

okay so this module is literally the guts of CPANPLUS β€” like, the whole inner ecosystem, the plumbing, the main character organs. πŸ«€

and here's the iconique part: it inherits from all other modules in the CPANPLUS::Internals::* namespace, which means it is fully out here defying normal rules of OO programming. not me casually breaking object orientation like it's nothing πŸ˜­πŸ’€

but bestie, if you're reading this page, you already know what's going on ;) so. you get it. iykyk.

πŸŽ€ if you want the normal API β€” the one that doesn't require a secret handshake β€” please read the CPANPLUS::Backend documentation. that's the front door. this page is the trapdoor. πŸ”‘

✨ ACCESSORS ✨

  • _conf β€” get/set the configure object. πŸ’–
  • _id β€” get/set the id. πŸ”’

πŸ‘‘ METHODS πŸ‘‘

πŸ“ $internals = CPANPLUS::Internals->_init( _conf => CONFIG_OBJ )

_init creates a brand new CPANPLUS::Internals object. new object, fresh start, no baggage. πŸ’…

you have to pass it a valid CPANPLUS::Configure object β€” that's not optional, bestie, it's the whole entrance fee.

  • returns the object on success πŸŽ‰
  • dies on failure πŸ’€ (dramatic? yes. accurate? also yes.)

🌈 $bool = $internals->_flush( list => \@caches )

flushes the designated caches from the CPANPLUS object. spring cleaning but for memory. 🧹✨

  • returns true on success
  • returns false if one or more caches could not be flushed

🧚 $bool = $internals->_register_callback( name => CALLBACK_NAME, code => CODEREF )

registers a callback for later use by the internal libraries. set it now, let it cook. πŸ”₯

here's the list of the callbacks that are currently used:

  • install_prerequisite β€” is called when the user wants to be "asked" about what to do with prerequisites. should return a boolean: true to install the prerequisite, false to skip it.
  • send_test_report β€” is called when the user should be prompted if he wishes to send the test report. should return a boolean: true to send the test report, false to skip it.
  • munge_test_report β€” is called when the test report message has been composed, giving the user a chance to programmatically alter it. should return the (munged) message to be sent. ✍️
  • edit_test_report β€” is called when the user should be prompted to edit test reports about to be sent out by Test::Reporter. should return a boolean: true to edit the test report in an editor, false to skip it.
  • proceed_on_test_failure β€” is called when 'make test' or 'Build test' fails. should return a boolean indicating whether the install should continue even if the test failed. (test failed but we ball? that's the question this callback answers 😭)
  • munge_dist_metafile β€” is called when the CPANPLUS::Dist::* metafile is created, like control for CPANPLUS::Dist::Deb, giving the user a chance to programmatically alter it. should return the (munged) text to be written to the metafile. πŸ“

πŸ’œ $bool = $internals->_add_to_includepath( directories => \@dirs )

adds a list of directories to the include path. which means they get added to @INC as well as $ENV{PERL5LIB}. two places, one call, efficiency slay. πŸ’…

  • returns true on success, false on failure.

πŸŽ€ $bool = $internals->_add_to_path( directories => \@dirs )

adds a list of directories to the PATH β€” but only if they actually contain anything. empty folders need not apply. πŸ™ˆ

  • returns true on success, false on failure.

⭐ $id = CPANPLUS::Internals->_last_id

return the id of the last object stored. the most recent one. the baby of the family. πŸ‘Ά

πŸ¦‹ $id = CPANPLUS::Internals->_store_id( $internals )

store this object; return its id. put it in the vault, get the receipt. πŸ”

πŸ”₯ $obj = CPANPLUS::Internals->_retrieve_id( $ID )

retrieve an object based on its ID β€” return false on error. no object? you get a false. that's the deal. 🀝

🌸 CPANPLUS::Internals->_remove_id( $ID )

remove the object marked by $ID from storage. gone. deleted. not coming back. πŸ’¨

🌈 @objs = CPANPLUS::Internals->_return_all_objects

return all stored objects. the whole friend group, everyone accounted for. 🫢


🫢 heads up bestie: those last few (_last_id, _store_id, _retrieve_id, _remove_id, _return_all_objects) are class methods β€” you call them on CPANPLUS::Internals itself, not on an instance. the more you know. ✨

and that's the whole page, babes β€” no notes, ate and left no crumbs. πŸ’… this lil tour was brought to you by perl v5.40.1, dated 2025-03-01, and filed under CPANPL...ternals(3pm) in the User Contributed Perl Documentation section. go be iconic with your internals. mwah. πŸ’–πŸŽ€πŸ¦‹

πŸ“¦ where this page comes from