Bringing Java into Perl

Using the Inline::Java Perl module it's possible to use inline Java code in your Perl code:

use strict;
use warnings;

use Inline Java => <<'EOJ';
public class Hi {
   String greeting;

   public Hi(String greeting) {
      this.greeting = greeting;

   public void setGreeting(String newGreeting) {
      greeting = newGreeting;

   public String getGreeting() {
      return greeting;

my $greeter = Hi->new("howdy");
print $greeter->getGreeting(), "\n";

Of course it's also possible to use already compiled Java code from within Perl.

Read about Inline::Java in this article.