syntax(3pm)

πŸ“¦
version 0.004 Β· 4 versions
, in debian bookworm, debian trixie, ubuntu jammy, ubuntu noble

πŸ’– syntax β€” bestie's guide to activating syntax extensions πŸ’–

okay so this is syntax(3pm), a User Contributed Perl Documentation page, and honestly? it's giving magic plugin loader for Perl and i'm obsessed. let's get into it πŸ¦‹


✨ NAME ✨

syntax β€” Activate syntax extensions. that's it, that's the whole vibe. it turns syntax extensions ON. πŸ’…


πŸŽ€ VERSION πŸŽ€

version 0.004


🌸 SYNOPSIS 🌸

here's how you actually use it, bestie:

    # either
    use syntax 'foo';

    # or
    use syntax foo => { ... };

    # or
    use syntax qw( foo bar ), baz => { ... };

three flavors, pick ur fighter ✨


πŸ’œ DESCRIPTION πŸ’œ

okay so this module activates community provided syntax extensions to Perl. the way it works is: you hand it a feature name, and optionally a scalar with arguments, and then the dispatching system goes and loads + installs the extension into your package. no cap. πŸ”₯

the import arguments are parsed with Data::OptList. there are no standardised options. like, zero. none. so please go consult the documentation for the specific syntax feature you're using to find out about possible configuration options, because this module is not gonna tell you πŸ™ˆ

and here's the cute little transformation: the passed in feature names are simply transformed. so "function" becomes Syntax::Feature::Function, and "foo_bar" would become Syntax::Feature::FooBar. it just capitalizes the words and smooshes em together, slay ✨


πŸ‘‘ METHODS πŸ‘‘

πŸ’« import

    syntax->import( @spec );

this method will dispatch the syntax extension setup to the specified feature handlers for the calling package. so whoever called it? that's who gets the new syntax. main character energy fr.

πŸ’« import_into

    syntax->import_into( $into, @spec );

same as "import", but it performs the setup in $into instead of the calling package. so you can point it at somebody else 🫢

πŸ’« unimport

    syntax->unimport( @features );

this method will trigger uninstallations of the @features from the calling package. bye bye syntax πŸ‘‹πŸ˜­

πŸ’« unimport_from

    syntax->unimport_from( $from, @features );

same as "unimport", but will uninstall the @features from $from. again with the pointing-at-someone-else thing. consistent queen πŸ’…


  • Syntax::Feature::Function

Activates functions with parameter signatures. literally the one you want, iykyk πŸ”₯


🌈 SEE ALSO 🌈

Syntax::Feature::Function, Devel::Declare


πŸ’€ BUGS πŸ’€

please report any bugs or feature requests to bug-syntax@rt.cpan.org or through the web interface at:

http://rt.cpan.org/Public/Dist/Display.html?Name=syntax

(go on, tell them, they wanna know πŸ₯Ί)


πŸ’– AUTHOR πŸ’–

Robert 'phaylon' Sedlacek <rs@474.at>


This software is copyright (c) 2012 by Robert 'phaylon' Sedlacek.

This is free software; you can redistribute it and/or modify it under the same terms as the Perl 5 programming language system itself.


and that's the whole page, bestie!! ✨ this was syntax(3pm) from perl v5.32.0, dated 2020-12-29, and you can find it filed under the syntax(3pm) manual. go forth and extend ur syntax, you got this πŸ’œπŸ¦‹πŸŒΈ

πŸ“¦ where this page comes from