dtRdr::Hack

dtRdr::Hack is a Perl module with self-documenting adaptive finger-wagging global vars.
Download

dtRdr::Hack Ranking & Summary

Advertisement

  • Rating:
  • License:
  • Perl Artistic License
  • Price:
  • FREE
  • Publisher Name:
  • Eric L. Wilhelm
  • Publisher web site:
  • http://search.cpan.org/~ewilhelm/Date-Piece-v0.0.2/lib/Date/Piece.pm

dtRdr::Hack Tags


dtRdr::Hack Description

dtRdr::Hack is a Perl module with self-documenting adaptive finger-wagging global vars. dtRdr::Hack is a Perl module with self-documenting adaptive finger-wagging global vars.SYNOPSISThis is a global store for things that cannot otherwise be cleanly solved at the moment. package WayOver::OnThe::Left; use dtRdr::Hack; dtRdr::Hack->set_variableB(45); package Bottom::Right::Corner; use dtRdr::Hack; my $variableB = dtRdr::Hack->get_variableB;Basically, just a way to formalize global variable sharing.Arrays, hashes, objects, and globs are all passed and stored directly as references.DeclarationsVariables are declared in the clarations and precated hashes in the Hack.pm code. To deprecate variables, move them rather than duplicating.The behavior is controlled by the following constants, which should be similar to perl's warnings and strict pragmas (less the lexical aspects and dynamic switchability.) my clared = ( some_scalar => '', # scalar some_array => [], # array some_hash => {}, # hash some_univ => bless({}, 'UNIVERSAL'), # any object some_obj => bless({}, 'dtRdr::Book'), # class or subclass some_sub => sub {_die 'ex_sub'}, # declare subs like this some_undef => undef, # run-time typing );TODO: you can currently set an object where you declared a hash, but STRICT should probably not allow that.Moving variables to precated allows you to denote that your code should no longer be using these. my precated = ( some_other_scalar => '', some_other_array => [], some_other_hash => {}, some_other_sub => sub {_die 'ex_sub'}, );NOTE: The sub {_die 'ex_sub'} idiom lets you stop yourself from calling what you thought was set elsewhere. Requirements: · Perl


dtRdr::Hack Related Software