Le mercredi 19 juillet 2006 à 13:59, A. Pagaltzis écrivait: > * David Landgren <[EMAIL PROTECTED]> [2006-07-19 13:40]: > > The problem is that these associations are private to the XS > > and Perl module. The client code does not need to know about > > them, and in fact shouldn't. So I don't want client code to > > know the file exists, and people won't go around trying to > > include it. So the Perl file has to go. > > Might Pod::Constants help? > > =begin constants > > FOO => 1 > BAR => 2 > QUUX => 3 > > =end constants
In the same vein, and without an external module, you could also simply expose the information in the documentation, and fetch it from there: (a trick I discovered thanks to Abigail's additions to Acme::MetaSyntactic, see the upcoming Acme::MetaSyntactic::tour_de_france for an example): my %const = map { s/\s+//; $_ } map { split /\s*=>\s*/ } grep {/=>/} map { split /\n/ } << '=cut'; =pod This module uses the following constants: bang_eth => 1 biff => 2 krunch => 3 =cut -- Philippe "BooK" Bruhat There are two sides to every cause. Do not join one until you know the other. (Moral from Groo The Wanderer #105 (Epic))