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

    Hash::Diff::Dispatch 0.01

    Download button

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

    License / Price:

    Last Updated:

    Category:
    Pete Sergeant | More programs
    Perl Artistic License / FREE
    August 15th, 2007, 18:05 GMT
    ROOT / Programming / Libraries

     Read user reviews (0)  Refer to a friend  Subscribe

    Hash::Diff::Dispatch description

    Hash::Diff::Dispatch allows to execute code depending on difference between hashes.

    Hash::Diff::Dispatch allows to execute code depending on difference between hashes.

    SYNOPSIS

    my $hash_watcher = Hash::Diff::Dispatch->new(

    {}, # Sets the starting hash

    # The events will be called using the order returned
    # by calling 'keys' on these values...

    'b' => &bold,
    'i' => &italic,

    );


    # Will call: bold('on', 5)
    $hash_watcher->update( { b => 5, a => 'la' } );

    # Will call: bold('changed', 6)
    $hash_watcher->update( { b => 6 } );

    # Will call: bold('changed', 0)
    $hash_watcher->update( { b => 0 } );

    # Will call: bold('off')
    $hash_watcher->update( {} );

    METHODS

    new

    Accepts a starting hash-ref, and then a list of keys you want to watch, and the code to execute when they change. It will take a copy of the hash in the hash-ref you specify.

    update

    Accepts a hash-ref, which it'll take a copy of, and make it the 'saved' hash to check the next call to update again.
    If a key's value has changed, it'll execute the code specified when you created the object. If the key exists where it didn't before, it'll pass 'on' as the first argument, and the new value as the second. If it's changed, 'changed' and the new value. If it's been deleted, it'll pass 'off'.

    Product's homepage

    Requirements:

    · Perl

      


    TAGS:

    hash diff | execute code | Perl module | diff | hash | dispach

    Go to top

    WindowsGamesDriversMacLinuxScriptsMobileHandheldNews

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