Spoon::Base(3)

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

πŸ’– 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 (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