Damian Conway <[EMAIL PROTECTED]> writes: > sub { > ... > return $yadda_yadda; > } > always { close F } Let's try not to fall into the Java trap. If exception handling gets too wordy, programmers will try to reduce the overhead by combining many statements. In Java, one often sees things like: try { ... enormous amount of statements ... } catch ( Exception e ) { e.printStackTrace(); } As a result, error messages become utterly useless. I almost never see a Java program that reports "Cannot open file foo". Instead, it reports a java.lang.ioerrorexception and a stracktrace of several pages. Useless if you do not have the source, often even if you have. And no, don't call this just a programmer's habit. It is significantly induced by the formality and verbosity of the language. Compare: open my $f, $thefile or die ("$thefile: $!\n"); with try { File f = new File (theFile); } catch ( FileNotFoundException e1 ) { System.err.println (theFile + ": Not found"); System.exit(); } catch ( IOErrorException e2 ) { System.err.println (theFile + ": IO error"); System.exit(); } catch ( ... ) { ... } -- Johan
- Re: assign to magic name-of-function variable instead of &... abigail
- Re: assign to magic name-of-function variable instead of &... abigail
- Re: assign to magic name-of-function variable instead of &... David L. Nicol
- Re: assign to magic name-of-function variable instead of &... Glenn Linderman
- Re: assign to magic name-of-function variable instead of &... Damian Conway
- Re: assign to magic name-of-function variable instead... Edward Peschko
- Re: assign to magic name-of-function variable instead... Glenn Linderman
- Re: assign to magic name-of-function variable instead... Johan Vromans
- Re: assign to magic name-of-function variable instead of &... abigail
- Re: assign to magic name-of-function variable instead of &... James Mastros
- Re: assign to magic name-of-function variable instead of &... John Porter
- Re: assign to magic name-of-function variable instead of &... Tony Olekshy
- Re: assign to magic name-of-function variable instead... Glenn Linderman
- Re: assign to magic name-of-function variable instead of &... Bart Lateur
- Re: assign to magic name-of-function variable instead of &... Johan Vromans
- Re: assign to magic name-of-function variable instead... John Porter
- Re: assign to magic name-of-function variable instead... Ariel Scolnicov