Help for this page

Select Code to Download


  1. or download this
    open(DATA, "$db") || die "Can not open: $!\n";
    my @dat = (<DATA>);
    close(DATA);
    open(DATA, "$db") || die "NO GO: $!\n";
    
  2. or download this
    while (<DATA>) {
       # ...
       open(DATA,"> test4.txt") or die $!;;
       # ...
    }
    
  3. or download this
    my $i = 0;
    while ($i < 5) {
       open (OUT, '>oops.txt') || die "NO GO: $!\n";
       print OUT $i;
       $i++;
    }
    
  4. or download this
    open (OUT, '>oops.txt') || die "NO GO: $!\n";
    my $i = 0;
    while ($i < 5) {
       print OUT $i;
       $i++;
    }