Softpedia
 


LINUX CATEGORIES:



GLOBAL PAGES >>
NEWS ARCHIVE >>
SOFTPEDIA REVIEWS >>
MEET THE EDITORS >>
WEEK'S BEST
  • Linux Kernel 3.9.3 / 3....
  • LibreOffice 3.6.6 / 4.0.3
  • MPlayer 1.1.1
  • systemd 204
  • Arch Linux 2013.05.01
  • Blender 2.67a
  • KDE Software Compilatio...
  • CrunchBang Linux Stable...
  • Elementary OS 0.1 / 0.2...
  • SystemRescueCd 3.6.0
  • Home > Linux > Programming > Libraries

    Set::Object 1.24

    Download button

    No screenshots available
    Downloads: 320  View global page NEW!  Tell us about an update
    User Rating:
    Rated by:
    Good (3.0/5)
    5 user(s)
    Developer:

    License / Price:

    Last Updated:

    Category:
    Jean-Louis Leroy | More programs
    Perl Artistic License / FREE
    July 24th, 2008, 02:11 GMT
    ROOT / Programming / Libraries

     Read user reviews (0)  Refer to a friend  Subscribe

    Set::Object description

    Set::Object Perl module contains a set of objects and strings.

    Set::Object Perl module contains a set of objects and strings.

    SYNOPSIS

    use Set::Object;

    my $set = set(); # or Set::Object->new()

    $set->insert(@thingies);
    $set->remove(@thingies);

    @items = @$set; # or $set->members;

    $union = $set1 + $set2;
    $intersection = $set1 * $set2;
    $difference = $set1 - $set2;
    $symmetric_difference = $set1 % $set2;

    print "set1 is a proper subset of set2"
    if $set1 < $set2;

    print "set1 is a subset of set2"
    if $set1 new(@stack);
    while (my $object = pop @stack) {
    if (reftype $object eq "HASH") {
    # do something with hash members

    # add the new nodes to the stack
    push @stack, grep { ref $_ && $seen->insert($_) }
    values %$object;
    }
    elsif (reftype $object eq "ARRAY") {
    # do something with array members

    # add the new nodes to the stack
    push @stack, grep { ref $_ && $seen->insert($_) }
    @$object;

    }
    elsif (reftype $object =~ /SCALAR|REF/) {
    push @stack, $$object
    if ref $$object && $seen->insert($$object);
    }
    }

    This modules implements a set of objects, that is, an unordered collection of objects without duplication.
    The term objects is applied loosely - for the sake of Set::Object, anything that is a reference is considered an object.

    Set::Object 1.09 and later includes support for inserting scalars (including the empty string, but excluding undef) as well as objects. This can be thought of as (and is currently implemented as) a degenerate hash that only has keys and no values. Unlike objects placed into a Set::Object, scalars that are inserted will be flattened into strings, so will lose any magic (eg, tie) or other special bits that they went in with; only strings come out.

    Requirements:

    · Perl



    Product's homepage

    Requirements:

    · Perl

      


    TAGS:

    Perl objects | Perl strings | Perl module | Perl | objects | strings

    Go to top

    WindowsGamesDriversMacLinuxScriptsMobileHandheldNews

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