This is Perl code. _java_bin returns the full path to the java executable. From http://search.cpan.org/~dolmen/DateTime-TimeZone-HPUX-1.04/lib/DateTime/TimeZone/HPUX.pm our @JAVA_HOMES = ( '/opt/java1.4', ); { my $_java_bin; sub _java_bin { return $_java_bin if defined $_java_bin; $_java_bin = ''; # Default value: java not found (false) foreach ( (map { ("$_/jre/bin/java", "$_/bin/java") } (exists $ENV{JAVA_HOME} ? ($ENV{JAVA_HOME}) : ()), @JAVA_HOMES, ), (map { "$_/java" } split(/:/, $ENV{PATH}) ), ) { next unless -x "$_"; $_java_bin = $_; last; } return $_java_bin; } }