Help for this page

Select Code to Download


  1. or download this
    for ('A' .. 'Z') {
        if(my $counter = ($_ eq 'F' .. $_ eq 'J')) {
            print "$counter: $_\n";
        }
    }
    
  2. or download this
    for ('A' .. 'Z') {
        if((my $first = $_ eq 'F') .. (my $last = $_ eq 'J')) {
            printf "%s first:%s last:%s\n", $_, $first?'yes':'no', $last?'
    +yes':'no', ;
        }
    }
    
  3. or download this
    for (1 .. 8) {
        if((my $first = $_ % 3 == 0) .. (my $last = $_ % 3 == 0)) {
            printf "%s first:%s last:%s\n", $_, $first?'yes':'no', $last?'
    +yes':'no', ;
        }
    }
    
  4. or download this
    for (1 .. 8) {
        if((my $first = $_ % 3 == 0) ... (my $last = $_ % 3 == 0)) {
            printf "%s first:%s last:%s\n", $_, $first?'yes':'no', $last?'
    +yes':'no', ;
        }
    }