Help for this page

Select Code to Download


  1. or download this
    # Create a file array of lines
    while ($line = <FILE>){
        push (@array, $line);
    }
    
  2. or download this
    my @array = <FILE>;
    
  3. or download this
    # Then control the output
    foreach $index (@array){
    ...
            print "$index";
        }
    }
    
  4. or download this
    for (@array) {
        print unless /^(\n|\s+)$/;
    }