OpenFra...Response(3)

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

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