Help for this page

Select Code to Download


  1. or download this
    open (FILE, ">data.txt") or die "Oops! Perl whines: $!\n";
    for my $i (0..$#screenres) {
    ...
         # continue in the same vein as required
    }
    close FILE;
    
  2. or download this
    # opens data.txt for writing, *erases* old data.txt
    open (FILE, ">data.txt")
    
    # opens data.txt for appending, adds data to end of data.txt 
    open (FILE, ">>data.txt")