[PBP-pm] Named constants from modules?

Damian Conway damian at conway.org
Wed Nov 23 23:51:35 PST 2005


>>However, the book also recommends against allowing export
>>of any variables from modules.
> 
> True, but scalars, arrays and hashes created with Readonly aren't
> variable variables.
> 
> So the interface variable prohibition on making variables part
> of a modules interface wouldn't really apply. The reasoning behind that
> prohibition is that you want to control exposure of a module's
> internal state, access to that state, and how it can be changed.
> 
> None of those reasons apply to the non-modifiable "variables" constructed
> with Readonly.

This is certainly true. I will review the guideline and the 
Perl6::Export::Attrs module with a view to allowing it.

Damian



More information about the PBP-pm mailing list