Param(3pm)
πΈ APR::Request::Param β the manual, but make it cute πΈ
okay bestie, listen. This is the Param(3pm) page from the User Contributed Perl Documentation collection, and it's literally the whole entire wrapper for libapreq2's param API. Grab a boba, we're doing this. β¨
β¨ NAME β¨
APR::Request::Param β it's a wrapper for libapreq2's param API. That's the whole vibe. π
π SYNOPSIS π
use APR::Request::Param;
$arg1 = $req->args('alpha');
$body = $req->body;
$body->param_class("APR::Request::Param");
ok $_->isa("APR::Request::Param") for values %$body;
@uploads = grep {$_->upload} values %$body;
$param = $body->get('beta');
$param->upload_slurp(my $content);
π¦ DESCRIPTION π¦
So the APR::Request::Param module hands you base methods for interfacing with libapreq2's param API. It also comes with a couple of utility functions and constants, as a lil treat. π
And heads up: this manpage documents version 2.17 of the APR::Request::Param, APR::Request::Brigade, and APR::Request::Brigade::IO packages. All three. In one page. She's an overachiever, we love her. π
π OVERLOADS π
π APR::Request::Param
""
"$param"
The double-quote interpolation operator maps to APR::Request::Param::value(). Yes ma'am, stringifying just gives you the value. β¨
π METHODS π
π APR::Request::Param
name
$param->name()
Returns the param's name. This attribute cannot be modified β it is what it is, no notes, no edits. π
value
$param->value()
Returns the param's value. This attribute cannot be modified either. Leave her alone!! π
is_tainted
$param->is_tainted()
$param->is_tainted($set)
Get/set the param's internal tainted flag. But wait, there's a plot twist: if the param's charset is APREQ_CHARSET_UTF8 (8), this also activates the SvUTF8_on flag during calls to name() and/or value(). character development!!
$tainted = $param->is_tainted;
$param->is_tainted(0);
ok $param->is_tainted == 0;
charset
$param->charset()
$param->charset($set)
Get/set the param's internal charset. The charset is a number between 0 and 255, and the current recognized values are:
0 APREQ_CHARSET_ASCII (7-bit us-ascii)
1 APREQ_CHARSET_LATIN1 (8-bit iso-8859-1)
2 APREQ_CHARSET_CP1252 (8-bit Windows-1252)
8 APREQ_CHARSET_UTF8 (utf8 encoded Unicode)
Oh and like, see is_tainted above for the tea about how APREQ_CHARSET_UTF8 relates to perl's UTF-8 flag. π₯
$charset = $param->charset;
$param->charset(2);
ok $param->charset == 2;
make
APR::Request::Param->make($pool, $name, $value)
Fast XS param constructor. Zoom zoom. ποΈ
info
$param->info()
$param->info($set)
Get/set the APR::Table headers for this param. π
upload
$param->upload()
$param->upload($set)
Get/set the APR::Brigade file-upload content for this param. π€
upload_filename
$param->upload_filename()
Returns the client-side filename associated with this param. The name the client picked, bestie. π«Ά
upload_link
$param->upload_link($path)
Links the file-upload content with the local file named $path. It creates a hard-link if the spoolfile's (see upload_tempname) temporary directory is on the same device as $path; otherwise this writes a copy. π
upload_slurp
$param->upload_slurp($data)
Reads the entire file-upload content into $data. Slurp. It's giving thirsty. π₯€
upload_size
$param->upload_size()
Returns the size of the param's file-upload content. π
upload_type
$param->upload_type()
Returns the MIME-type of the param's file-upload content. text/slay, probably. No wait, that's not in the docs, ignore me β it returns the MIME-type, fr fr. π
upload_tempname
$param->upload_tempname()
Returns the name of the local spoolfile for this param. ποΈ
upload_io
$param->upload_io()
Returns an APR::Request::Brigade::IO object, which can be treated as a non-seekable IO stream. Non-seekable. Remember that. It's important. π
upload_fh
$param->upload_fh()
Returns a seekable filehandle representing the file-upload content. Oh so now we're seekable. Glow up. β¨
π§ METHODS π§
π APR::Request::Brigade
This class is derived from APR::Brigade, providing additional methods for TIEHANDLE, READ and READLINE.
And here's the thing you actually need to know: to be memory efficient, these methods delete buckets from the brigade as soon as their data is actually read, so you cannot seek on handles tied to this class. It's gone. Consumed. No take-backs. Such handles have semantics similar to that of a read-only socket. π
new, TIEHANDLE
APR::Request::Brigade->TIEHANDLE($bb)
Creates a copy of the bucket brigade represented by $bb, and blesses that copy into the APR::Request::Brigade class. This provides syntactic sugar for using perl's builtin read, readline, and <> operations on handles tied to this package:
use Symbol;
$fh = gensym;
tie *$fh, "APR::Request::Brigade", $bb;
print while <$fh>;
Syntactic sugar, but make it slay. π¬
READ
$bb->READ($contents)
$bb->READ($contents, $length)
$bb->READ($contents, $length, $offset)
Reads data from the brigade $bb into $contents. When omitted, $length defaults to -1, which reads the first bucket into $contents. A positive $length will read in $length bytes, or the remainder of the brigade, whichever is greater. $offset represents the index in $context to read the new data. πΎ
READLINE
$bb->READLINE()
Returns the first line of data from the bride. Lines are terminated by linefeeds (the '\012' character), but we may eventually use $/ instead. (Yes, the original says "bride" and honestly? Iconic typo, keeping it. π°)
π«§ METHODS π«§
π APR::Request::Brigade::IO
read
OO interface to APR::Request::Brigade::READ. π―
readline
OO interface to APR::Request::Brigade::READLINE. π―
π SEE ALSO π
APR::Request, APR::Table, APR::Brigade. Go read those too, bestie, it's a whole universe. π
π COPYRIGHT π
Licensed to the Apache Software Foundation (ASF) under one or more
contributor license agreements. See the NOTICE file distributed with
this work for additional information regarding copyright ownership.
The ASF licenses this file to You under the Apache License, Version 2.0
(the "License"); you may not use this file except in compliance with
the License. You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
and that's the whole page, bestie β perl v5.42.3, dated 2026-08-21, Param(3pm), from the User Contributed Perl Documentation section. you ate that. periodt. π β¨
π¦ where this page comes from
- ubuntu stonking: libapreq2-doc 2.17-9build1 Β· Apache-2.0
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms