Stories
Slash Boxes
Comments
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

The Fine Print: The following comments are owned by whoever posted them. We are not responsible for them in any way.
 Full
 Abbreviated
 Hidden
More | Login | Reply
Loading... please wait.
  • I don't know much Java, but one of the criticisms of some Perl programmers is that they program Perl in C (i.e. using C idioms like for(i=0;i<N;i++)). Is it possible that using substring like 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 dun
    • by davegaramond (3597) on 2008.02.15 20:30 (#61099)

      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?