Autodi...er::ASP(3pm)

πŸ“¦
version 2.14 Β· 3 versions
, in debian bookworm, debian trixie, ubuntu noble

πŸ‘‘ Autodia::Handler::ASP β€” the ASP handler, bestie edition

Okay so this is a 3pm page from the User Contributed Perl Documentation β€” it's the manual for Autodia::Handler::ASP, aka the AutoDia handler for ASP. If you're here, you're probably trying to make AutoDia understand your .asp files, and honestly? valid. Let's go. πŸ¦‹


✨ NAME ✨

Autodia::Handler::ASP β€” the AutoDia handler for ASP. That's it, that's the whole vibe. πŸ’…


🌸 INTRODUCTION 🌸

Autodia::Handler::ASP is registered in the Autodia.pm module, which β€” and this is the important part β€” holds a hash of language names paired up with the name of their respective language handler. In this case it looks like:

%language_handlers = ( .. ,                  asp =>
"Autodia::Handler::ASP",                  .. );

%patterns = ( .. ,            asp => \%asp,
              .. );

my %asp    = ( regex   => '\w+.asp',            wildcards => ['asp'],
          );

So yeah, <mint>asp</mint> gets mapped to <mint>Autodia::Handler::ASP</mint>, it gets its own pattern entry, and the actual pattern definition matches <yellow>'\w+.asp'</yellow> with the wildcard <yellow>['asp']</yellow>. iykyk ✨


πŸŽ€ CONSTRUCTION METHOD πŸŽ€

Making one of these bad boys is literally two lines, no cap:

use Autodia::Handler::ASP;

my $handler = Autodia::Handler::ASP->New(\%Config);

This creates a new handler using the Configuration hash to provide the rules selected at the command line. So whatever you picked on the command line? That's what your handler is working with. iconic behavior. πŸ‘‘


πŸ’… ACCESS METHODS πŸ’…

🌟 Parse

$handler->Parse(filename); # where filename includes full or relative path.

This parses the named file and returns 1 if it was successful, or 0 if the file could not be opened. That's your vibe check right there β€” truthy means we ate, falsy means the file said "not today". 😭

Heads up bestie: filename needs the full path or a relative path β€” it's not gonna go hunting around for you. 🫢

🌈 output

$handler->output(); # any arguments are ignored.

This outputs the output file according to the rules in the %Config hash passed at initialisation of the object, plus the template. And fr fr, any arguments you throw at it? Ignored. It does not care. It does not want them. It's giving unbothered main character energy. πŸ’…βœ¨


That's the whole page, bestie β€” go forth and parse those ASP files. πŸ¦‹

Signing off with the receipts: this page is from the User Contributed Perl Documentation, perl v5.36.0, dated 2022-11-02. Periodt. πŸ’–

πŸ“¦ where this page comes from