On Thu, Jul 29, 2010 at 3:28 PM, Bill Moseley <mose...@hank.org> wrote:
> Wondering what you use for constants in your modules.

I actually do stuff like

BEGIN {
   my %SmallEnglishNumbers = qw/
      ONE => 1 TWO => 2 TWELVE => 12, INF => -1 , ZAPHOD => 42
   /;
  my $block;
  while (my ($k,$v) = each %SmallEnglishNumbers){
      $block .= "sub $k() { $v }\n";
  }
  eval "$block 1" or die "Whoops, botched block:\n$block\n with err:\n$@"
}

pretty regularly.

The thing Constant:: will give you that this approach doesn't is dualvars.

Reply via email to