Help for this page

Select Code to Download


  1. or download this
    open (INPUTFILE, "<:encoding(UTF-8)", "in.txt") or die "Can't open fil
    +e: $!";
    for (my $i = 1; $i < 5; $i++) {
    ...
        }
    }
    close INPUTFILE;
    
  2. or download this
    for (my $i = 1; $i < 5; $i++) {
        open (INPUTFILE, "<:encoding(UTF-8)", "in.txt") or die "Can't open
    + file: $!";
    ...
        }
        close INPUTFILE;
    }
    
  3. or download this
    print "First loop:\n\n";
    while (<DATA>) {
    ...
    first line
    second line
    third line