On 03/05/2013 11:01 AM, Bill Ricker wrote:
Damian Conway in PBP ch.4 argues for 'use Readonly;' rather than 'constant'.


first off, greg needs to export the symbols as someone has said. several ways to do that including the classic Exporter module.

as for Readonly vs use constant, they are different beasts. only constants will be compile time folded and code wrapped in if ( FALSE_VALUE ) will not even be compiled. Readonly sets a flag that is checked at runtime, not compile time. it's big advantage is you can interpolate them as they are regular vars and not symbol constants. so don't replace one with the other as they do different things.

uri



_______________________________________________
Boston-pm mailing list
Boston-pm@mail.pm.org
http://mail.pm.org/mailman/listinfo/boston-pm

Reply via email to