XML::Pa...tchName(3)

🎀 NAME 🎀

okay so bestie, welcome to the XML::PatAct::MatchName(3) page — it's from User Contributed Perl Documentation. The header is out here vibing as XML::Pa...tchName(3) because truncation said “not today” 💀, but the actual star of the show is this:

XML::PatAct::MatchName — a pattern module for matching element names.

✨ SYNOPSIS ✨

Here’s the lil code moment, copy it exactly and don’t let anyone tell you otherwise:

        use XML::PatAct::MatchName;

        my $matcher = XML::PatAct::MatchName->new();

        my $patterns = [ 'foo' => ACTION,
                         'bar/foo' => ACTION,
                         ... ];

🦋 DESCRIPTION 🦋

So XML::PatAct::MatchName is a pattern module for use with PatAct drivers when you’re applying pattern-action lists to XML parses or trees. It’s giving simple, iconic, does-one-thing energy: it uses just element names to match on. 🎯

If multiple names are supplied, separated by "/" characters, then all of the parent element names must match as well. Yes bestie, the whole parent chain has to line up, iykyk. 🫶

The order of patterns in the list is not significant. XML::PatAct::MatchName will use the most specific match. Using the synopsis above as the example: if you have an element "foo", then "bar/foo" will match if "foo" is in an element "bar"; otherwise just the pattern with "foo" will match. Slay specificity, periodt. 💅

👑 AUTHOR 👑

The author is Ken MacLeod, at ken@bitsko.slc.ut.us 💌

🌈 SEE ALSO 🌈

  • perl(1)
  • “Using PatAct Modules” and “Creating PatAct Modules” in libxml-perl.
okay that’s the page! huge mwah to perl v5.42.0 and the date 2024-03-04 for the footer moment — XML::Pa...tchName(3) signing off 🫶✨💅
📦 where this page comes from