NOTE: use Perl; is on undef hiatus. You can read content, but you can't post it. More info will be forthcoming forthcomingly.
All the Perl that's Practical to Extract and Report
Stories, comments, journals, and other submissions on use Perl; are Copyright 1998-2006, their respective owners.
idiomatic? (Score:1)
for(i=0;i<N;i++)). Is it possible that usingsubstringlike that in Java is just a bad "translation" from Perl to Java, and there is a more natural Java-esque way to do it (not necessarily including only that particular statement, but possibly also the larger problem you're working on; e.g. it might be more natural to use an input stream and read from it or whatever -- I dunRe:idiomatic? (Score:1)
I think the moral of the story is that Java throws exception for the littlest things. If I try to open a file and it fails, an exception is a sensible thing, as the next lines in the code would expect the file handle to be there.
But if you take a substr($str, $offset, $len), do you expect to always get exactly $len characters worth of substring?
Reply to This
Parent