PDF::Bu...F::Array(3)
π PDF::Builder::Basic::PDF::Array β the manual, but make it cute π
okay so bestie, quick vibe check: this page is from the User Contributed Perl Documentation set, and the module we're stanning today is PDF::Builder::Basic::PDF::Array(3). It's literally a Perl class that corresponds to a PDF array. That's the whole personality. It's giving "container class that knows how to write itself out to a PDF file." π
Also important: it inherits from PDF::Builder::Basic::PDF::Objind. Family lineage, we love to see it. π
β¨ METHODS β¨
πΈ new
PDF::Array->new($parent, @values)
Creates an array. You hand it the storage $parent, and then optionally a list of @values to initialise the array with. That's it, that's the constructor. No drama, no cap. π
π¦ outobjdeep
$a->outobjdeep($fh, $pdf)
This one outputs the array as a PDF array to the given filehandle $fh. Sounds iconic, right? Well... ngl, it's unusual to need to call this method from user code. It's an internal-ish thing. So like, you can, but do you need to? Probably not, bestie. π
π elements
$a->elements()
Returns the contents of the array. The actual stuff inside. The whole point of the object, fr fr. β¨
π add_elements
$a->add_elements(@elements)
Appends the given @elements to the array. But listen β there's a lil rule: an element is only added if it is defined. So if you're passing undef in there, it's just not gonna make it in. The array has standards. π
π remove_element
$a->remove_element($element)
Removes all occurrences of $element from the array. Not one. Not the first one. ALL of them. It's thorough like that. π
β val
$a->val()
Returns a reference to the contents of the array. Note: a reference, not a copy. Just so we're clear. π
π§ copy
$a->copy($pdf)
Copies the array β with deep-copy on elements which are not full PDF objects, with respect to a particular $pdf output context. So it's a smart copy: things that are full PDF objects stay referenced, things that aren't get deep-copied for that specific $pdf context. Main character energy, honestly. π
π«Ά tiny reminder bestie: everything above is exactly what the manpage says, just with more sparkle. Don't come for me if you called outobjdeep in user code and it was weird β I warned you. π
and that's a wrap on PDF::Builder::Basic::PDF::Array! this page ships as part of perl v5.42.0, dated 2026-01-17. go forth and array responsibly. slay. π
β¨π
π¦ where this page comes from
- fedora 44: perl-PDF-Builder 3.028-2.fc44 Β· LGPL-2.1-or-later AND LGPL-2.1-only AND MIT
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms