Help for this page

Select Code to Download


  1. or download this
    my $start_number = 1;
    my $end_number = 10;
    for (my $i=$start_number; $i<=$end_number; $i++) {
        print "\$i = $i\n";
    }
    
  2. or download this
    foreach my $i (1 .. 10) {
        print "\$i = $i\n";
    }
    
  3. or download this
    foreach my $i ('A' .. 'D') {
        print "\$i = $i\n";
    }