Beefy Boxes and Bandwidth Generously Provided by pair Networks
Think about Loose Coupling
 
PerlMonks  

Re: Set::Range - conditional testing on sets

by $code or die (Deacon)
on Apr 23, 2001 at 23:44 UTC ( [id://74836]=note: print w/replies, xml ) Need Help??

Help for this page

Select Code to Download


  1. or download this
            use Set::Range;
    
  2. or download this
            my %set= ('1' => {      lower => 0,
                                    upper => 10,
    ...
                                    lower_inclusive => 1,
                             },
                    );
    
  3. or download this
            my $range=Set::Range->new(\%set);
            print $range->getState('19', NUM_RANGE);
            # prints "2"
    
  4. or download this
            my %set= ('Jan' => {    lower => '1/1/2001',
                                    upper => '1/31/2001',
    ...
                                    lower_inclusive => 1,
                             }, # Days in February
                    );
    
  5. or download this
            my $range=Set::Range->new(\%set);
    
  6. or download this
            print $range->getSet('1/11/2001', DATE_RANGE);
            # prints "Jan"
    
  7. or download this
        Pass new() a reference to a Hash containing the set
        information.
    
  8. or download this
      The hash defining the sets contains one hash per set
      with at least 'upper' and 'lower' defined.
      'upper_inclusive' and 'lower_inclusive' are optional
      and are the equivalent of >= and <= for the upper and 
      lower set boundries.
    
  9. or download this
      The set hash can look like this:
    
  10. or download this
    
      { 
    ...
                    upper_inclusive => 1,
                  },
       }
    
  11. or download this
    
      etc... The lower and upper values can either be
      numeric values or date values in the form
      mm/dd/yyyy or dd/mm/yyyy (see C<getSet> for
      Euro-formatted dates)
    
  12. or download this
        my $set = $range->getSet(10);
        my $set = $range->getSet('1/14/2002', DATE_RANGE);
    

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://74836]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others perusing the Monastery: (3)
As of 2024-04-25 10:18 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found