Spoon::Base(3)
π Spoon::Base β¨
okay bestie, welcome to Spoon::Base(3) β the generic Spoon base class, from the User Contributed Perl Documentation corner of the universe π«Ά she's giving foundational, she's giving main character energy for every plugin that inherits from her π
πΈ NAME πΈ
Spoon::Base β the Generic Spoon Base Class. that's it, that's the name, no notes π
β¨ SYNOPSIS β¨
use Spoon::Base '-Base';
literally one line and you're in, bestie π
π¦ DESCRIPTION π¦
So here's the tea β this is the base class for application plugins. She hands out basic functionality to all the modules that inherit from her, like a mom friend who always has snacks in her bag π no cap.
π SUBROUTINES π
okay important vibe check first: these subroutines are meant to be called bare, not as an object-method call. so like, don't come at them with a $self->, they're not about that life π
π§ trace
See Spoon::Trace::trace().
π§ conf(name, default)
Returns the configuration value for name, if it can be found in the config ($self->hub->config). Returns $default, otherwise. so you always get something back, she's reliable like that π
π METHODS π
π hub
Return the application's hub object. See Spoon::Hub.
π init
Inherited by all subclasses. Put your class initialization stuff here. like, this is the lil spot where you do your getting-ready routine β¨
π assert(boolean)
Die if the supplied argument is false. she said no false energy in this house π
π t([label])
Calls Spoon::Trace::mark(). See Spoon::Trace.
π clone
Copies a class instance. The copy is only a shallow one. so like, surface-level copy only, she's not doing a deep dive π«Ά
π is_in_cgi
Returns a boolean, indicating whether we were called from a CGI interface.
π is_in_test
Returns a boolean, indicating whether we were called from a test suite.
π have_plugin(class_id)
Tries to load a plugin. See Spoon::Hub::load_class().
π plugin_directory
Returns your plugin's directory. You can use this directory to store state. lowkey your lil home base π
π env_check(variable_name)
Sanity check: ensure the specified variable exists in %ENV. If the variable is not found, dies with a useful error message. it's giving protective, it's giving "bestie I checked for you" π₯Ί
π dumper_to_file(filepath, variable1 [, variable2...])
Uses Data::Dumper to save a dump of one or more variables to the specified file. screenshot the whole situation, why don't you πΈ
π has_utf8
Returns a boolean, indicating whether utf8 is available on this platform and version of perl.
π utf8_encode(string)
Encodes the string in utf8, if utf8 is available. Otherwise, returns $string unmodified. See Encode::encode().
π utf8_decode(string)
Decodes the string from utf8, if utf8 is available. Otherwise, returns $string unmodified. See Encode::decode().
π uri_escape(string)
Escapes all invalid URI characters. See CGI::Util::escape().
π uri_unescape(string)
Unescapes all invalid URI characters. See CGI::Util::unescape().
π html_escape(string)
Escapes all reserved characters. The result is suitable for including verbatim in an HTML document. See CGI::escapeHTML().
π html_unescape(string)
Escapes all reserved characters. The result is suitable for including verbatim in an HTML document. See CGI::unescapeHTML().
π base64_encode(string)
Encodes the specified string into Base64. See MIME::Base64::encode_base64().
π base64_encode(base64_data)
Decodes the specified data from Base64. See MIME::Base64::decode_base64().
bestie I'm literally just telling you what the page says, okay? π that second base64_encode(base64_data) line says what it says and I am NOT the one who's gonna rewrite the source material. I'm a vibe translator, not a fact fixer π
π TODO π
- Document what
Spoon::Base->debug()does.
(yes that's a real open item, we're all waiting, the mystery continues π΅οΈβοΈβ¨)
π AUTHOR π
Brian Ingerson <INGY@cpan.org> β king behavior, ty for your service π
π COPYRIGHT π
Copyright (c) 2004. Brian Ingerson. All rights reserved.
This program is free software; you can redistribute it and/or modify it under the same terms as Perl itself.
See http://www.perl.com/perl/misc/Artistic.html
and that's the whole page, bestie!! this lil icon was served up by perl v5.42.0, dated 2025-07-25, and yeah she's literally titled Spoon::Base(3) πβ¨ go forth and inherit responsibly π¦π
π¦ where this page comes from
- fedora 43: perl-Spoon 0.24-56.fc43 Β· GPL-1.0-or-later OR Artistic-1.0-Perl
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms