The Perl Toolchain Summit needs more sponsors. If your company depends on Perl, please support this very important event.

NAME

Egg::GlobalHash - A constant rule is given to a global HASH for Egg.

SYNOPSIS

  my %global;
  tie %global, 'Egg::GlobalHash', (
    key1 => 'hooo',
    key2 => 'booo',
    ...
    );
  
  $global{'abc123'}= 'hoge';  # The error happens. 
  
  $global{'ABC123'}= 'hoge';  # It succeeds. 
  
  $global{'ABC123'}= 'bomb';  # It makes an error because it has defined it.
  
  $global{'123ABC'}= 'hiii';  # The head makes an error and the figure makes an error.
  
  tied($global)->global_overwrite( ABC123=> 'hoge' );
  # It is allowed that it does in this manner.
  
  tied($global)->global_overwrite( abc123=> 'hoge' );
  # This makes an error. The key is an always capital letter. 
  
  tied($global)->flag_set( abc123=> 'hoge' );
  # It enters if it is this call. However, it is 0 or 1 to enter.
  
  print $global{abc123};  => 1
  
  for (@{tied(%global)->flags}) { print "[$_]" }   => [abc123]
  
  for (@{tied(%global)->globals}) { print "[$_]" } => [ABC123]

DESCRIPTION

An unpleasant thing happens when a global variable is readily put in and out. It is a module to restrict it.

However, it is possible to put it in and out from the second key quite freely because it is not severe.

  $global{ABC123}{abc123}= 'OK';
  $global{ABC123}{abc123}= 'OVERWRIE';

METHODS

flags

The list only of the data of the key to the small letter is returned by the ARRAY reference.

globals

The list only of the data of the key to the capital letter is returned by the ARRAY reference.

flag_set

Only the value of the small letter key is put. The superscription is allowed. However, the reference is not put, and the value becomes 0 or 1, too.

global_overwrite

Only the value of the capital letter key is put. The superscription is allowed. The value is freely put by an arbitrary type.

SEE ALSO

Egg::Release,

AUTHOR

Masatoshi Mizuno, <lushe@cpan.org>

COPYRIGHT AND LICENSE

Copyright (C) 2007 Bee Flag, Corp. <http://egg.bomcity.com/>, All Rights Reserved.

This library is free software; you can redistribute it and/or modify it under the same terms as Perl itself, either Perl version 5.8.6 or, at your option, any later version of Perl 5 you may have available.