try { FileInputStream inStream = new FileInputStream( args[0] ); inStream = ("myFile.txt"); } catch(IOException ioerr) { System.out.println( ioerr.toString() ); } #### open(FH,"myFile.txt") or die "Nope : $!\n"; #### die "Nope : $!\n" unless open(FH,"myFile.txt"); #### if (not open FH, 'myFile.txt') { print STDERR "Nope : $!\n"; exit; } #### !open FH => 'myFile.txt' == 0 && die "Nope : $!\n";