Help for this page

Select Code to Download


  1. or download this
    try {
      FileInputStream stream = new FileInputStream(myFile);               
    +                                                                 
      DataInputStream input  = new DataInputStream(stream);               
    +                                                                 
    ...
    catch (Exception e) {
        System.err.println("Could not read from file");
    }
    
  2. or download this
    open INPUT, "<", $input or die "Cannot open ($input) for reading: $!";
    print <INPUT>;
    close INPUT or die "Could not close $input: $!";