Help for this page

Select Code to Download


  1. or download this
    my @array;
    
    while (my $data = <FH>) {
        push @array, $data;
    }
    
  2. or download this
    my @array = <FH>;
    
  3. or download this
    foreach (@array) {
        chomp;
    ...
            print "$_\t is equal to average.\n";
        }
    }
    
  4. or download this
    c:\@Work\Perl\monks>perl -wMstrict -le
    "my @array = (-2, -1, 0, 1, 2);
    ...
    -1       is below average.
    1        is above average.
    2        is above average.
    
  5. or download this
    c:\@Work\Perl\monks>perl -wMstrict -le
    "print average();
    ...
     }
    "
    0