#!/usr/bin/perl
use warnings;
use strict;

for (0 .. 10) { #iterate $_ from 0 .. 10
    if ($_ == 2 .. $_ == 7) { #flip-flop depending on value
        print "$_ "; 
    }
}

#prints:
#   2 3 4 5 6 7
