Softpedia
 


LINUX CATEGORIES:



GLOBAL PAGES >>
NEWS ARCHIVE >>
SOFTPEDIA REVIEWS >>
MEET THE EDITORS >>
WEEK'S BEST
  • Linux Kernel 3.9.6 / 3....
  • Linux Kernel 3.0.82 LTS...
  • KDE Software Compilatio...
  • PulseAudio 4.0
  • Wireshark 1.10.0
  • NetworkManager 0.9.8.2
  • LibreOffice 3.6.6 / 4.0...
  • SystemRescueCd 3.7.0
  • Linux Kernel 3.10 RC6
  • Ubuntu Tweak 0.8.5
  • Home > Linux > Programming > Libraries

    Tie::Hash::KeysMask 0.01

    Download button

    No screenshots available
    Downloads: 366  View global page NEW!  Tell us about an update
    User Rating:
    Rated by:
    NOT RATED
    0 user(s)
    Developer:

    License / Price:

    Last Updated:

    Category:
    Josef Schönbrunner | More programs
    Perl Artistic License / FREE
    August 10th, 2007, 21:05 GMT
    ROOT / Programming / Libraries

     Read user reviews (0)  Refer to a friend  Subscribe

    Tie::Hash::KeysMask description

    Tie::Hash::KeysMask - control key aliasing by mask function, e.g. omit case of character distinction.

    Tie::Hash::KeysMask - control key aliasing by mask function, e.g. omit case of character distinction.

    SYNOPSIS

    use Tie::Hash::KeysMask;

    my $mask = sub {...};
    tie %argH, 'Tie::Hash::KeyMask',$mask, more arguments;

    Yield that the key mask function &$mask translates any key
    when applied to %argH like ..

    $k => $mask->($k, more arguments)

    that is

    $argH{$k} expands to $argH{$mask->($k, more arguments)}
    $argH{$k} = $v expands to $argH{$mask->($k, more arguments)} = $v

    If e.g. choose key mask sub {uc $_[0]} one can access an element without care of case of the key. In place of sub { } particular items can be used which will be translated into a CODE. The translation is

    'lc' => sub { lc $_[0] }
    'uc' => sub { uc $_[0] }
    %M => sub { exists $M{$_[0]} ? $M{$_[0]} : $_[0]}

    A class-method codemap manage this translation. If it is pleased one could override it and add ones own translations.
    This class inherits from Tie::Hash::Create by which the tied hash can be obtained anonymously as reference with the command

    'Tie::Hash::KeyMask'->newHASH (sub {...}, more arguments)

    which overrides the tie syntax calling tie from body of newHash.

    Product's homepage

    Requirements:

    · Perl

      


    TAGS:

    control key aliasing | mask function | character distinction | tie | hash | mask

    Go to top

    WindowsGamesDriversMacLinuxScriptsMobileHandheldNews

    SUBMIT PROGRAM   |   ADVERTISE   |   GET HELP   |   SEND US FEEDBACK   |   RSS FEEDS   |   UPDATE YOUR SOFTWARE   |   ROMANIAN FORUM