Beefy Boxes and Bandwidth Generously Provided by pair Networks
There's more than one way to do things
 
PerlMonks  

comment on

( [id://3333]=superdoc: print w/replies, xml ) Need Help??

To get to the point: Is there a software project out there to give Java Perl power? I'm not talking about taking my perl code and stuffing it into Java, I'm talking about some org.perl.* packages that will reduce my coding time with lovely Java versions of perl beauties like map, (un)pack, printf, and grep. For example:

<p>import org.perl.*;</p> <p>Collection foo = Perl5.unpack(template, string);</p>

map, grep: Good idea for rapid prototyping. I see that one proposal is already in...just fine-tune it. There are several Java classes derived from an abstract list type.

printf: This C-ism is ill-advised, even in Perl. I think of it as "C portability support". In the absence of a perfect analog, I would become familiar with the higher-level text I/O instead.

pack/unpack: Java is designed to protect you from binary. Any pure Java implementation is likely to have the speed of molasses in July.

There are analogs of the LWP module family in Java; I would be concentrating on that for high-level internet connectivity. For instance, an image can be specified with a URL source. It's interesting watching 14 images load asynchronously....

I would also be careful with braces. If the coding style guidelines permit, you can use them to force temporary variables to go out of scope before the function exits. This is a RAM efficiency measure. The object here is not Perl-like code, but Perl-like memory recycling.


In reply to Re: Perl Functionality in Java by zaimoni
in thread Perl Functionality in Java by samurai

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



  • Are you posting in the right place? Check out Where do I post X? to know for sure.
  • Posts may use any of the Perl Monks Approved HTML tags. Currently these include the following:
    <code> <a> <b> <big> <blockquote> <br /> <dd> <dl> <dt> <em> <font> <h1> <h2> <h3> <h4> <h5> <h6> <hr /> <i> <li> <nbsp> <ol> <p> <small> <strike> <strong> <sub> <sup> <table> <td> <th> <tr> <tt> <u> <ul>
  • Snippets of code should be wrapped in <code> tags not <pre> tags. In fact, <pre> tags should generally be avoided. If they must be used, extreme care should be taken to ensure that their contents do not have long lines (<70 chars), in order to prevent horizontal scrolling (and possible janitor intervention).
  • Want more info? How to link or How to display code and escape characters are good places to start.
Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others learning in the Monastery: (5)
As of 2024-03-28 20:43 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found