My primary language of employment is Java, but it's been a long time since I was on the steep part of the learning curve. One thing I thought I'd throw out there would be to read the Javadoc both for the core api and any other libraries you might be using. It's the Java counterpart to perldoc. I think that would take you a long way.

For example, string splitting? You might look at the documentation for java.lang.String and see it has a split method! Regexes in general? A search from the overview page would reveal the java.util.regex package.

Yes, you're going to be typing a whole lot more :-( If Perl is like Charles Dickins' prose in its expressiveness, Java is more like a third-grader's paper on what they did last summer.

As a general piece of advice, I would recommend imitating other code you can find in your project, or in reputable open-source libraries (say, part of the Apache Group). I think cargo-culting is your friend here, as long as you make sure you understand the code you're copying. This is just my opinion though, so if others have contrasting viewpoints, they might be more convincing.


In reply to Re: From Perl to Java by crashtest
in thread From Perl to Java by ropey

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.