OpenFra...Response(3)
π OpenFra...Response β like, the response era β¨
okay bestie, we're in OpenFra...Response(3) territory, from the User Contributed Perl Documentation corner of the internet, and this one is a whole vibe. it's the abstract response class. let's get into it π¦
πΈ NAME πΈ
OpenFrame::Response β an abstract response class. that's it, that's the name, slay π
β¨ SYNOPSIS β¨
here's the little taste test, copy it exactly, no notes:
use OpenFrame;
use OpenFrame::Constants;
my $r = OpenFrame::Response->new();
$r->message("<html><body>Hello world!</body></html>");
$r->mimetype('text/html');
$r->code(ofOK);
$r->cookies(OpenFrame::Cookies->new());
look at her go. main character energy fr fr π
π«Ά DESCRIPTION π«Ά
so OpenFrame::Response represents responses inside OpenFrame. a response is, like, the thing that comes back after someone asks for information β the request gets a response, the way a text gets a reply, iykyk π
this module abstracts the way clients can respond with data from OpenFrame. it's giving layer of abstraction, it's giving pluggable, it's giving iconic. periodt.
π METHODS π
new()
this method creates a brand new OpenFrame::Response object. it takes no parameters. zero. nada. it's an independent queen, it needs nothing from you β¨
cookies()
this method gets and sets the OpenFrame::Cookietin that is associated with this response.
my $cookietin = $r->cookies();
$r->cookies(OpenFrame::Cookies->new());
yes bestie, Cookietin. that's the spelling in the source, we do not edit the source, we respect the source π
message()
this method gets and sets the message string associated with this response. a scalar reference can be stored. it will always be returned as a scalar.
my $message = $r->message();
$r->message("<html><body>Hello world!</body></html>");
ok so real talk: you can hand her a scalar ref, but she's gonna hand you back a scalar. that's the deal. no cap.
code()
this method gets and sets the message code associated with this response. the following message codes are exported when you use OpenFrame::Constants: ofOK, ofERROR, ofREDIRECT, ofDECLINE.
my $code = $r->code();
$r->code(ofOK);
four codes, four moods: ofOK π, ofERROR π, ofREDIRECT π, ofDECLINE π
mimetype()
this method gets and sets the MIME type associated with this response.
my $type = $r->mimetype();
$r->mimetype('text/html');
tell the world what you are. text/html? gorgeous. be loud about it π£οΈπ
π AUTHOR π
James Duncan <jduncan@fotango.com>
shoutout to James, the original author, the blueprint, the moment π«Ά
and that's the whole page, bestie!! this was perl v5.42.0, dated 2025-07-25, brought to you by User Contributed Perl Documentation β mwah, go build something cute πβ¨
π¦ where this page comes from
- fedora 43: perl-OpenFrame 3.05-55.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