I have several modules that use large tables to generate code and other tables, etc. Usually, these tables look like this:
These can go several levels deep. The problem I've run into is that I like the arrow notation, as it makes the tables easy and intuitive to read. However, since I use constants and left side of the arrow is placed in quotes, I have to call the constant explicitly, using ampersand.use constant SOME_TABLE => { &SOMECONSTANT => [ &ANOTHER1 => sub { ... }, &CONST2 => sub { ... }, ], ....... };
The problem with this is that if such constant is undefined (due to a type-o, for instance), this error will not get caught until run-time. It would be neat to catch these bastards at compile-time, but then I have to lose the arrow and use a comma instead.
Question: is there a way to catch undefined subroutines at compile-time and keep using the arrow notation at the same time?
In reply to Constants and arrow notation. by dmitri
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |