in reply to "Obviously, You Will Need a Java Course..."
and compare it with this :-try { FileInputStream inStream = new FileInputStream( args[0] ); inStream = ("myFile.txt"); } catch(IOException ioerr) { System.out.println( ioerr.toString() ); }
or this:open(FH,"myFile.txt") or die "Nope : $!\n";
or this:die "Nope : $!\n" unless open(FH,"myFile.txt");
or even this:if (not open FH, 'myFile.txt') { print STDERR "Nope : $!\n"; exit; }
Every one of those are (probably) valid Perl. And at a glance, they all look like they might kinda work. That's the tradeoff. A diagonal language like Perl, is terse and expressive, not only do you see the same thing done in several ways, you will revel in it. With orthogonal languages like Java, you code may be verbose and ugly, but everyone's code verbose and ugly in the same way, and there is less detective work involved.!open FH => 'myFile.txt' == 0 && die "Nope : $!\n";
|
---|