Help for this page

Select Code to Download


  1. or download this
    my @foo = qw/a b c d e f g/;
    for my $x (@foo) {
        push @foo, 'd' if $x eq 'd';
        print $x;
    }
    
  2. or download this
    push @foo, map {$_ eq 'd' ? 'd' : ()} @foo;
    print for @foo;
    
  3. or download this
    for (@foo) {
      print;
      shift(@foo) if $_ eq 'c';
    }
    print "\n@foo\n";