Parser:...le::Subs(3)
πΈ NAME πΈ
XML::Parser::Style::Subs β bestie, it is literally the glue π«Ά for handling element callbacks. Welcome to the User Contributed Perl Documentation page for it (yes, the one hanging out as Parser:...le::Subs(3), iykyk).
β¨ SYNOPSIS β¨
use XML::Parser;
my $p = XML::Parser->new(Style => 'Subs', Pkg => 'MySubs');
$p->parsefile('foo.xml');
{
package MySubs;
sub foo {
# start of foo tag
}
sub foo_ {
# end of foo tag
}
}
π DESCRIPTION π
Okay so here's the tea β: every time an element starts, a sub with that element's name gets called β and it's a sub inside the package you specified with the Pkg option. It gets the exact same parameters that the Start handler gets called with. Slay. π
Every time an element ends, a sub with that same name plus an underscore ("_") appended gets called. It gets the exact same parameters that the End handler gets called with. No cap. β¨
And parse? It literally returns nothing special. That's it. Iconic. π
Vibe check: in the example,foois the start-of-foocallback andfoo_is the end-of-foocallback β the underscore is the whole lil' signal π¦
mwah π β footer vibes: perl v5.42.0, dated 2026-03-20. From the User Contributed Perl Documentation girlies. periodt π
π¦ where this page comes from
- opensuse-leap 16.0: perl-XML-Parser 2.470.0-160000.3.1 Β· Artistic-2.0
- opensuse-leap 16.0: perl-XML-Parser 2.470.0-160000.3.1 Β· Artistic-2.0
- opensuse-leap 16.0: perl-XML-Parser 2.470.0-160000.3.1 Β· Artistic-2.0
- opensuse-leap 16.0: perl-XML-Parser 2.470.0-160000.3.1 Β· Artistic-2.0
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms