Help for this page

Select Code to Download


  1. or download this
    use warnings;
    use strict;
    ...
    my @times2;
    
    for my $elmt (@times) {
    
  2. or download this
        if (! @times1 || $elmt - $times1[-1] >= 10) {
            push @times1, $elmt;
            next;
        }
    
  3. or download this
        if (! @times2 || $elmt - $times2[-1] >= 10) {
            push @times2, $elmt;
            next;
        }
    
  4. or download this
        push @times1, $elmt;
    }
    
  5. or download this
    print "Times1: @times1\n";
    print "Times2: @times2\n";
    
  6. or download this
    Times1: 5 20 30 40 50 65 75 90
    Times2: 10 25 45 55 80