in reply to I don't like annotation syntax

There are some use cases of attributes, because it has compile-time effects.

Mostly meta-programming, like in debugging or macro expansion.

But the biggest problem is IMHO the implementation of the arguments of an attribute

In :attribute(args-list) args-list isn't parsed like a Perl list but some kind of string like in qw ... and here are dragons.

Cheers Rolf
(addicted to the Perl Programming Language :)
Wikisyntax for the Monastery

Replies are listed 'Best First'.
Re^2: I don't like annotation syntax
by Liebranca (Acolyte) on Jul 13, 2022 at 21:39 UTC

    At one point I used an actual code attribute to register subroutines for inlining; the attribute sub itself did some processing of a B::Deparse'd version of the code (gotten with coderef2text or something) and then saved some metadata to a hash. Later on, I'd dump the entire thing to a file on an INIT block.

    I've deprecated that system already for unrelated reasons, but it was pretty nice for a lazy way of automatically gathering stuff from files. I found attributes themselves to be useful most of the time, my gripe is purely syntactical.

    I *am* quite mad ;>