SPVM::B...Resource(3)
β¨ SPVM::B...Resource(3) β¨
okay so bestie, this page lives in the User Contributed Perl Documentation section of the manual (yes, that's the manual name, don't come for me π«Ά), and it's literally all about SPVM::Builder::Resource β a whole class for manipulating resources. iykyk π
πΈ NAME πΈ
SPVM::Builder::Resource β Resource. that's it, that's the name, short and iconic π
π¦ DESCRIPTION π¦
the SPVM::Builder::Resource class has methods to manipulate resources. no cap, that's the whole vibe check. β¨
π USAGE π
here's how you actually get one of these bad boys going:
my $resource = SPVM::Builder::Resource->new(
class_name => 'Resource::Zlib',
);
see? not scary at all. main character energy fr fr π
π§ DETAILS π§
for the full tea on creating and using resources, go peek at SPVM::Document::Resource. it's giving "read the other page first" but like, lovingly π
β FIELDS β
class_name
my $class_name = $resource->class_name;
$resource->class_name($class_name);
gets and sets the "class_name" field β which is, shocking twist, the class name of this resource. obsessed with the naming consistency honestly π
config
my $config = $resource->config;
$resource->config($config);
gets and sets the "config" field, which is an SPVM::Builder::Config object. a whole object, living inside your resource, slay π
π CLASS METHODS π
new
my $resource = SPVM::Builder::Resource->new(%fields);
creates a brand new SPVM::Builder::Resource object using "Fields". fresh out the box, no notes π
Field Default Values:
"class_name"βundef"config"βundef
like, both start out as undef because you get to decide their destiny. character development arc pending π±
π INSTANCE METHODS π
to_string
my $string = $resource->to_string;
returns the "class_name" field. that's it. simple, clean, ate π₯
π¦ OPERATORS π¦
overloads the following operators. fancy, i know β¨
bool
my $bool = !!$resource;
always true. literally always. your resource is that confident ππ
stringify
my $class_name = "$resource";
the alias for the "to_string" method. so when you stringify it, you get the class name β same energy, different syntax π
πΈ COPYRIGHT & LICENSE πΈ
Copyright (c) 2023 Yuki Kimoto
MIT License
and that's the whole page bestie, every single detail preserved, zero cap ππ
okay and the cute lil sign-off: this gorgeous thing is from perl v5.42.2, dated 2026-02-03 β so when you're citing it, that's your source and your date, periodt π
π
π¦ where this page comes from
- alpine 3.24: spvm-doc 0.990125-r0 Β· MIT
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms