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 > Perl Modules

    Hash::Slice 0.02

    Download button

    No screenshots available
    Downloads: 364  View global page NEW!  Tell us about an update
    User Rating:
    Rated by:
    Fair (2.1/5)
    6 user(s)
    Developer:

    License / Price:

    Last Updated:

    Category:
    Robert Krimen | More programs
    Perl Artistic License / FREE
    November 29th, 2007, 01:14 GMT
    ROOT / Programming / Perl Modules

     Read user reviews (0)  Refer to a friend  Subscribe

    Hash::Slice description

    Hash::Slice can make a hash from a deep slice of another hash.

    Hash::Slice can make a hash from a deep slice of another hash.

    SYNOPSIS

    use Hash::Slice qw/slice cslice/;

    # A trivial example
    my %hash = (a => 1, b => 2, c => 3);

    my $slice = slice %hash, qw/a b/;

    # $slice is now { a => 1, b => 2 }


    # A hairy example
    my %hash = (a => 1, b => 2, c => { d => 3, e => 4 });

    my $slice = slice %hash, qw/a/, [ c => qw/e/ ];

    # $slice is now { a => 1, c => { e => 4 } }


    # An even hairier example
    my %hash = (a => 1, b => 2, c => { d => 3, e => 4, f => { g => 5, h => 6, k => [ 0 .. 4 ] } }, z => 7);

    my $slice = slice %hash, qw/a z/, [ c => qw/e/, [ f => qw/g k/ ] ];

    # $slice is now { a => 1, z => 7, c => { e => 4, f => { g => 5, k => [ 0, 1, 2, 3, 4 ] } } }


    # Make a cloned-slice of %hash
    my %hash = (a => 1, b => 2, c => { d => 3, e => 4, f => { g => 5, h => 6, k => [ 0 .. 4 ] } }, z => 7);

    my $slice = cslice %hash, qw/a z/, [ c => qw/e/, [ f => qw/g k/ ] ];
    $slice->{c}->{e} = "red"; # $hash{c}->{e} is still 4

    Product's homepage

    Requirements:

    · Perl

      


    TAGS:

    make hash | hash slice | Perl module | hash | slice | Perl

    Go to top

    WindowsGamesDriversMacLinuxScriptsMobileHandheldNews

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