Module Releases Archives

Lexical readonly state variables with PerlX::Let

I’ve released a new module PerlX::Let that adds a new “let” keyword so that you can do the following:

let $x = 1,
     $y = "string" {

  if ( ($a->($y} - $x) > ($b->{$y} + $x) )
  {
    something( $y, $x );
  }

}

with this, you can have lexical readonly variables, and avoid bugs due to typos.

A nice feature of this is that it uses state variables if the assigned value is a constant, and the value is a scalar (for Perls older than 5.28).

Const::Exporter Released

A few days ago, I released Const::Exporter to CPAN.

Basically, it's a module that allows you to define a module with exportable constants that:

  • can be read-only scalars, arrays, or hashes (as well as the standard constant functions);
  • can refer to each other;
  • can be grouped into export tags, and added to multiple tags without repeating the value;
  • and easily interspersed with POD describing the constants.

A more detailed discussion of it is on my blog /users/robert_rothenberg/module-releases/index.html

About Robert Rothenberg

user-pic I was born on the Moon but kidnapped by astronauts and raised in the suburbs of Grumman. Eventually, I drifted along the Gulf Stream to Northern Europe. Blogs about Perl, Puppet, Linux, programming, and whatever etc.