Help for this page

Select Code to Download


  1. or download this
    foreach my $a (1 .. 5) {
        next while ($a != 2);
    }
    
  2. or download this
    my @strings = ('a', 'b', 'c', 'd', 'e', 'f');
    while (my $s = shift @strings) {
    ...
        next while ($s =~ /a/ .. $s =~ /c/);
        print "$s is OK!\n";
    }
    
  3. or download this
    my @strings = ('a', 'b', 'c', 'd', 'e', 'f');
    while (my $s = shift @strings) {
        print "Looking at $s\n";
    ...
        next if $value;
        print "$s is OK!\n";
    }
    
  4. or download this
    Looking at a
    The value is 1
    ...
    Looking at f
    The value is
    f is OK!