HTML::...Source(3pm)
π NAME π
okay so bestie, welcome to HTML::...Source(3pm), straight from the User Contributed Perl Documentation girlies. The actual queen here is HTML::Mason::ComponentSource β and she represents information about an component. yes, "an component," we are keeping that exactly, no notes, iconic. π
β¨ SYNOPSIS β¨
my $info = $resolver->get_info($comp_path);
that's the whole flex. one line. slay. π¦
πΈ DESCRIPTION πΈ
Mason uses the ComponentSource class to store information about a source component, one that has yet to be compiled. lowkey crucial, highkey underrated. β¨
π METHODS π
π new π
This method takes the following arguments:
comp_pathβ the component's component path. literally what it says, bestie.last_modifiedβ this is the last modification time for the component, in Unix time (seconds since the epoch). β°comp_idβ this is a unique id for the component used to distinguish two components with the same name in different component roots.
If your resolver does not support multiple component roots, this can simply be the same as the "comp_path" key or it can be any other id you wish.
This value will be used when constructing filesystem paths so it needs to be something that works on different filesystems. If it contains forward slashes, these will be converted to the appropriate filesystem-specific path separator.
In fact, we encourage you to make sure that your component ids have some forward slashes in them or also all of your generated object files will end up in a single directory, which could affect performance. so yes, put slashes in there, bestie, your filesystem will thank you. π«Ά
comp_classβ the component class into which this particular component should be blessed when it is created. This must be a subclass ofHTML::Mason::Component, which is the default. πfriendly_nameβ this is used when displaying error messages related to the component, like parsing errors. This should be something that will help whoever sees the message identify the component. For example, for component stored on the filesystem, this should be the absolute path to the component. be nice, give it a good name. πsource_callbackβ this is a subroutine reference which, when called, returns the component source.
The reasoning behind using this parameter is that it helps avoid a profusion of tiny little HTML::Mason::ComponentSource subclasses that don't do very much. we love avoiding a profusion of tiny little subclasses, fr fr. π
extraβ this optional parameter should be a hash reference. It is used to pass information from the resolver to the component class.
This is needed since a HTML::Mason::Resolver subclass and a HTML::Mason::Component subclass can be rather tightly coupled, but they must communicate with each through the interpreter (this may change in the future). iykyk. π§
Then there are these simple accessors:
comp_pathlast_modifiedcomp_idcomp_classfriendly_nameextra
These are all simple accessors that return the value given to the constructor. no drama, just vibes. π
π¦ comp_source π¦
Returns the source of the component. that's it. she's giving source. π
π₯ object_code ( compiler => $compiler ) π₯
Given a compiler, this method returns the object code for the component. periodt. π
Peep these too: HTML::Mason, HTML::Mason::Admin, HTML::Mason::Component. the holy trinity of Mason-adjacent reading. πβ¨
okay bestie, that's the whole page. this manual is from perl v5.38.2, dated 2024-03-05, and it's the HTML::...Source(3pm) page. mwah ππ
π¦ where this page comes from
- debian trixie: libhtml-mason-perl 1:1.60-2 Β· Artistic-1.0-Perl OR GPL-1.0-or-later
- ubuntu noble: libhtml-mason-perl 1:1.60-2 Β· Artistic-1.0-Perl OR GPL-1.0-or-later
- ubuntu resolute: libhtml-mason-perl 1:1.60-2 Β· Artistic-1.0-Perl OR GPL-1.0-or-later
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms