Help for this page

Select Code to Download


  1. or download this
    open (FILE, "file") || die "file could not be opened";
    
  2. or download this
    $file = "some_file.txt"; 
    open(FILE,"$file") or &Error($!);
    
  3. or download this
    sub Error {
            $error = shift or $error = "unknown";
    ...
            print "Error:  $error";
            &End;
    }
    
  4. or download this
    close FILE or die "Could not close $file";