Help for this page

Select Code to Download


  1. or download this
      @x = (0, 'one', ' ', 3);
      $"=')(';
      print "(@x)";
    
  2. or download this
      my $i = 0;
      sub inc { ++$i }
    
      foreach (1..10) { print "$_\n" if(inc == 3 .. inc == 8) }
    
  3. or download this
    my $animal = 'pig';
    foreach $animal ('cat', 'dog', 'horse') {
      last if $animal eq 'dog';
    }
    print "$animal\n";