PPI::Token::BOM(3)
π PPI::Token::BOM(3) π
okay bestie, welcome to the PPI::Token::BOM page β straight out of the User Contributed Perl Documentation. this one's a lil niche but it's iconic, i promise π«Ά
β¨ NAME β¨
PPI::Token::BOM β the token that represents Unicode byte order marks. yes queen, the little invisible sparkles at the top of your file π
πΈ INHERITANCE πΈ
the family tree goes like this, no cap:
PPI::Token::BOM
isa PPI::Token
isa PPI::Element
so it's a PPI::Token, which is a PPI::Element. generational excellence honestly π
π¦ DESCRIPTION π¦
so here's the tea β β this is a special token, and the special part is that it can ONLY show up at the very beginning of a document. beginning only. nowhere else. that's its whole lane.
if a BOM byte mark shows up anywhere else in a file, it should be treated as PPI::Token::Whitespace instead. so like, it's not special anymore at that point, it's just background noise π«οΈ
we recognize the byte order marks that are identified at this URL:
<https://web.archive.org/web/https://www.unicode.org/faq/utf_bom.html#BOM>
and here they are, exactly, in all their hexadecimal glory:
UTF-32, big-endian 00 00 FE FF
UTF-32, little-endian FF FE 00 00
UTF-16, big-endian FE FF
UTF-16, little-endian FF FE
UTF-8 EF BB BF
now, a lil reality check π β as of this writing, PPI only has support for UTF-8 (namely, in POD and strings) and has no support for UTF-16 or UTF-32. we support the BOMs of the latter two for completeness only. so they're in the list, they're recognized, but they're not doing anything for you, they're just vibing β¨
and one more thing: the BOM is considered non-significant, like white space. it's not out here changing the meaning of anything. it's decorative. main character energy, zero plot relevance π
π METHODS π
there are no additional methods beyond those provided by the parent PPI::Token and PPI::Element classes. nothing extra, nothing hidden β everything you need is inherited from the parents, periodt π
π«Ά SUPPORT π«Ά
see the support section in the main module. go check it out, bestie, it's right there π
π AUTHOR π
Chris Dolan <cdolan@cpan.org>
β COPYRIGHT β
Copyright 2001 - 2011 Adam Kennedy.
This program is free software; you can redistribute it and/or modify it under the same terms as Perl itself.
The full text of the license can be found in the LICENSE file included with this module.
ok so like, legally speaking: free software, same terms as Perl, license text lives in the LICENSE file that ships with the module. not me reading license files for fun π
and that's the whole page, bestie!! π this was perl v5.42.0, dated 2026-01-17, and it's the PPI::Token::BOM(3) manual. slay, stay hydrated, go forth and parse responsibly π§ββοΈπβ¨
π¦ where this page comes from
- fedora 44: perl-PPI 1.284-2.fc44 Β· 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