Flame has asked for the wisdom of the Perl Monks concerning the following question:
Is there some way to declare a custom attribute inline?
For example: sub mysub($) : modifies { }.
My goal is to be able to tell myself that a sub I didn't necessaraly write wants a reference, without attempting to use the prototype for more than detecting the number of arguments. In this case, I would use prototype() and attributes::get() to determine that it needs one argument, and it needs to be able to modify the original, hence, needs a reference. If anyone can suggest a better way, please do so.Whenever I attempt to follow the example posted above, perl rejects the attribute as invalid... which it is... but it is only invalid because it isn't a built-in, the syntax is acceptable...
My code doesn't have bugs, it just develops random features.
Flame ~ Lead Programmer: GMS (DOWN) | GMS (DOWN)
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: custom attribute?
by chromatic (Archbishop) on Jan 28, 2003 at 06:26 UTC | |
|
Re: custom attribute?
by diotalevi (Canon) on Jan 28, 2003 at 13:00 UTC | |
by Flame (Deacon) on Jan 28, 2003 at 16:55 UTC | |
|
Re: custom attribute? (wrong channel)
by tye (Sage) on Jan 28, 2003 at 18:09 UTC | |
by Flame (Deacon) on Jan 28, 2003 at 21:45 UTC | |
by tye (Sage) on Jan 28, 2003 at 22:16 UTC | |
by Flame (Deacon) on Jan 28, 2003 at 23:25 UTC | |
by tye (Sage) on Jan 29, 2003 at 01:33 UTC | |
|